The Game: Pico, Fermi, Bagel

U of Washington Description

Some PFB Puzzles

The computer picks a 3-digit number at random in which no two digits are the same. The user must guess the number. If the human has a correct digit in the correct position then the computer displays “Fermi”. If the human has a correct digit in the wrong place then the computer displays ‘Pico’. If none of the human’s digits are in the computer’s number then the computer displays ‘Bagels’. Keep track of the number of guesses it takes for the human guess the computer’s number.

PicoFermiBagel.java starter code.

What else?

  1. Make the game with (4 or more) non-repeating digits
  2. Make the game with 3 (or more) digits, where a repeated digit is allowed.
  3. Cake you make a version where the computer is the player that guesses your number? Can you find the best strategy?
  4. Make the game ask which version on the game at the beginning
  5. Make the computer play against the play to see who gets it first.
  6. Can you make it more like Mastermind that has Four colors rather than 10 digits, but the colors can repeat?