The game use alphabets as the code and X,Y,Z as the answer comment instead of colors in this script.
Language: Windows Batch Script (.bat)
You can choose game level, number of attempts and choose whether it may contain duplicates or not and will have no empty spaces, which is usually 4 letters 6 codes 10 attempts
View the source code here:
https://github.com/wthe22/batch-scripts/blob/master/Mastermind.bat
Save this script as ANSI encoding by copying the script and paste it in notepad.

Totally unplayable because the turn scoring is faulty. For example, the correct code was "CEEA", my guess was "AABB", and the reported score was "XXYY". The correct score is "XXXY". See http://www.dostips.com/forum/viewtopic.php?p=39024#p39024 and http://www.dostips.com/forum/viewtopic.php?p=39040#p39040 for a pair of working batch mastermind games.
ReplyDeleteTurn scoring is fixed and new features are added :)
Delete