Bulls and Cows vs. MASTERMIND

General

You can play Bulls and Cows (= Cows and Bulls, MASTERMIND, SuperHirn) as browser game (HTML5 game) or as download for Android, Windows, Linux, FreeBSD / PC-BSD / TrueOS / GhostBSD / NomadBSD, Apple Mac OS X / OS X / macOS, Solaris and DOS / DOSBox (and thus OS/2 and RISC OS).

Bulls and Cows or Cows and Bulls is a logic-game for two players.
Bulls and Cows at Wikipedia.
MASTERMIND or SuperHirn is the commercial implementation of the game on a breadboard.
MASTERMIND at Wikipedia.

The program cannot only provide a solution but also guess
and thus becomes a real opponent for humans.
But you can also (for demonstration purposes) let the program play against itself or
play 'normal' with a friend, as you used to do without a computer or smartphone.
The program then monitors the game and only allows entries that conform to the rules.

Compared to the two original games, the game-program offers the following extensions: The individual game variants are in the simulation clearly explained.

On another paradox should be noted at this point:
Guessing strategy is to reduce the amount of allowed solutions with each guessing process as much as possible,
cheating strategy is to keep this quantity as large as possible.
The presumption is that a smaller amount of solutions will ever result in a faster solution,
surprisingly, the proof is wrong.
Both strategies, however, are still successful.
In the case of length of the code = 6 and 6 allowed characters ('colours') there is an anomaly:
If repetitions of characters are allowed, the computer needs 6 attempts to find the solution.
If repetitions of characters are not allowed, the computer needs 7 attempts to find the solution.
A tremendous reduction in the size of the initial solution set from 6 ^ 6 = 46 656 elements to 6! = 720 elements
increases the number of the required attempts from 6 to 7.
Using this variant the problem could only be solved by allowing generally no repetitions of characters,
when the Computer was 'cheating'.
In order that it is not so noticeable, I have chosen different start codes.


'Bulls and Cows' has a version number in the format 'Year-Month-Day' of the last change.
The actual version is:

To play, you can choose between:


Compare different operating systems

In order to guess, the computer has to request main memory (RAM), the more complex the task, the more memory.
The table shows how powerful the individual operating systems are (regardless of the time required):

Maximum size of the character set (number of 'colours'), depending on the operating system, RAM
and the length of the code to be guessed (by the computer !).
Length of the code to be guessed: 2 3 4 5 6 7 8 9 Maximum RAM:
Operating system used:
Browser- / Online-version 36 23 12 7 5 4 3 3 12^4 =             20 736 640 KB
DOS/DOSBox: DOS - Real Mode 36 23 11 7 5 4 3 3   3^9 =             19 683 640 KB
DOS/DOSBox: DOS - Protected Mode (DPMI) 36 36 33 17 11 8 6 5   8^7 =        2 097 152 64 MB
Windows+Solaris - Bulls and Cows 32 bit 36 36 36 31 17 12 8 7   7^9 =      40 353 607 2 GB
Linux+macOS+BSD - Bulls and Cows 32 bit 36 36 36 31 18 13 9 7 13^7 =      62 748 517 2 GB
Windows, Linux, macOS, FreeBSD - 64 bit
64-bit
-version of Bulls and Cows

needs much more memory
than Bulls and Cows 32 bit
36 36 36 29 16 11 8 6 29^5 =      20 511 149 2 GB
36 36 36 33 18 12 9 7   9^8 =      43 046 721 4 GB
36 36 36 35 21 13 9 7 21^6 =      85 766 121 8 GB
36 36 36 36 23 15 10 8 15^7 =    170 859 375 16 GB
36 36 36 36 26 16 11 8 26^6 =    308 915 776 32 GB
36 36 36 36 29 18 12 9 18^7 =    612 220 032 64 GB
36 36 36 36 33 20 13 10 33^6 = 1 291 467 969 128 GB
36 36 36 36 35 21 14 10 35^6 = 1 838 265 625 256 GB
For comparison: Original MASTERMIND   6^4 =               1 296

Simulation and Instruction of the Game (in the DOS / DOSBox-version)


Downloads for the specific operating systems: 

DOSBox           Android           Windows           Linux + FreeBSD           macOS           Solaris


Bulls and Cows for Android: Download and Installation:

Important!
As a rule, you do not have root rights on an Android device.
Then you cannot install the Android-versions of Bulls and Cows.
You also cannot operate the online version without a physical keyboard.

The best option is the DOSBox version.

For this you need: the zipped file BC.zip, a program to unzip this file
and a DOS-emulator for Android, preferably Magic DOSBox.
As a virtual keyboard is Hacker's Keyboard optimal, with all the necessary special characters.
A useful helper is Total Commander (with built-in editor).
As a service, the zipped file BC.zip contains the file BC.mgc, a profile for Magic DOSBox
with virtual buttons for a smartphone in vertical and horizontal orientation.

When everything is fully installed it looks like this on my smartphone (Huawei P30 Pro) in landscape format:

Android Magic DOSBox landscape mode

and in portrait format like this:

Android Magic DOSBox portrait mode


However, if you have root rights, e.g. on a rooted smartphone,
you can also install the Android version:


Install a terminal-emulator as well.
Choose the suitable program for your CPU (i386+x64 for Intel and AMD, arm+AArch64 for most mobile phones). Please copy the downloaded program into the directory /data/local/tmp
set the user rights there to 'Executable' with the command 'chmod 755 ...'.
Start the program from the terminal and select option 8 for the configuration in the main menu.
The Android-versions of Bulls and Cows were compiled with Free Pascal.


Bulls and Cows for Windows: Download:

Important!
You can play Bulls and Cows also within DOSBox or
a virtual computer with the operating system Linux.
Linux is much faster and DOSBox offers more options.

Please click warnings from the operating system away with 'Allow'
respectively 'More informations' -> 'Still execute'.
Start the program from the terminal and select option 8 for the configuration in the main menu.

Please choose 'Use Legacy console' and the 'Raster Font'
only with the program version with graphic characters.
To enjoy the game really you need also suitable
Fonts from Uwe Sieber, OEM Codepage 850.

The Windows-versions of Bulls and Cows were compiled with Free Pascal.

Configuration Windows

Properties of 'bc-windows': Options         Properties of 'bc-windows': Fonts

Properties of 'bc-windows': Layout         Properties of 'bc-windows': Colors


Bulls and Cows for Linux + FreeBSD: Download:

After download please set the user rights 'Executable'.
Please start your terminal, increase it to maximum size of the window,
respectively choose the profile settings of the terminal and set the terminal size 80 coloums and 25 lines.
Start the program from the terminal and select option 8 for the configuration in the main menu.
The Linux- and FreeBSD-versions of Bulls and Cows were compiled with Free Pascal.

Configuration Linux


Bulls and Cows for Apple Mac OS X / OS X / macOS: Download:

After download please set the user rights of bc-macos(64) respectively bc-macos(64)-ascii 'Executable'.
Start the program from the terminal and select option 8 for the configuration in the main menu.
The macOS-versions of Bulls and Cows were compiled with Free Pascal.

Configuration macOS


Bulls and Cows for Solaris: Download:

After download please set the user rights of bc-solaris respectively bc-solaris-ascii 'Executable'.
Please start your terminal, increase it to maximum size of the window.
Start the program from the terminal and select option 8 for the configuration in the main menu.
The Solaris-versions of Bulls and Cows were compiled with Free Pascal.

Configuration Solaris


HTML5 is valid!            Add to your favourites:   Strg  +  D 


Donation

I had a lot of fun with this project.
For me as an individual it also means an enormous investment of time.
I am happy if you like the game,
but I am also happy about financial recognition of my work.

If you want, you can transfer an amount of your choice to the following bank account:

GLS Gemeinschaftsbank eG
Account holder: Michael Kober
IBAN: DE89 4306 0967 7007 9199 01
BIC:   GENODEM1GLS

or send via PayPal as friend to the e-mail address michael@bulls-and-cows.de,
or even easier to use this PayPal-link.