AI PLAYER! for CodeBreaker/Mastermind
Game Introduction
I took richjones69's game where the human does the guessing, and made it into one where the computer does the guessing. It needs some work on the graphics, as this was a real quick hack. To do: I need to claim a win when there is exactly 1 solution possible. When there are no solutions left, we need to ask the user what their colors were, and then go back and show them where they made the mistake. And it could make better choices than just random... (though random seems to work quite well :-) )
How To Play
First you decide what colors your four hidden pegs will be and the order they are in. You don't tell the computer, so you need to remember them or write them down. (That way you know for sure that the computer can't cheat!) Choose from red, green, blue, purple, orange and yellow. You may choose the same color for more than one peg if you want. I'll make a guess, and you should rate it by awarding Black and White pegs. For each hidden peg, if my guess is the correct color and in the correct position, award me a Black; if my guess is present in your hidden pegs, but at a different place, award a White. NOTE: If there are duplicate colors in my guess, they cannot all be awarded a Black or White unless there are corresponding duplicate colors in your hidden code. For example, if the hidden code is red-red-green-green and the computer guesses red-red-red-green, you should award two Black pegs for the two correct reds, nothing for the third red as there is not a third red in the code, and a third Black peg for the green. If I can't guess your code in 12 tries, you win. I warn you that I usually guess your pegs in 6 or less tries! :-) (Actually, after adding a forced initial guess, it more often guesses correctly in 5 attempts) If you score inconsistently, I'll know.
Author
gtoal
Category
Game Information
Game Popularity
981 views
Collection Count
13 favorites