If you have ever played the classical board game, Mastermind, you will know how it works, guessing a certain combo, black pegs to mark if you got the colour right in the right spot white peg to mark a right colour but in the wrong spot, etc..
does anyone know how to add a white peg checker?
Basically how I think this could work is just check if every character in the player input is in the answer using the
in keyword like this:
"a" in "abc".
answer = "RRRR" # pretend this is the answer player = input("Guess: ") # pretend this is the player input for letter in player: if letter in answer: # can be either black or white # check for black else: white_pegs += 1
Hopefully this somewhat helps?