Python: Play with Kids on Bagel Pico Fermi Game

Bagel Pico Fermi is a math game where one person writes down a 3 or 4 digit number and the guessers try and figure it out based on process of elimination and strategy.Let explore more on the game play and program.

The Bagels Game Play

guess pico
guess pico
  1. Bagels is a deduction game in which the player tries to guess a random three-digit number (with no repeating digits) generated by computer. After each guess, the computer gives the player three types of clues.
  2. The three types of clues are:
    • Bagels: None of three digits guessed is in the secret number.
    • Pico: One of digits in the secret number, but the guess has the digit in the wrong place.
    • Fermi: The guess has a correct digit in the correct place.
  3. When the secret number match one of the player’s numbers, it will give fermi and pico for wrong place.

Practice with Bagel Program

pico guess
pico guess
  1. Create a get secret number function to generate new secret number.
  2. Create get clues to check if the guess and secret number match or misplace or no in the list at all.
    1. If secret number and guess is match exact same position, then show “fermi
    2. If secret number and guess is in the list, then show “pico
bagel code1
bagel code1
  1. Create is only digits function to make sure the input is number and clear if not.
  2. In the main program, tell the user to think of a number and its position.
  3. The maximum guess set to 10.
  4. Ask user for input for guesses which will be restrict to 3 number and only number.
  5. Print the clues with each guess
  6. If number of tries reach maximum guess, print that your guess is running out
bagel code2
bagel code2

Let play the Bagel game and have fun with your friends or kids from 3+ years old.

bagel output
bagel output

Thanks for reading and have a great day!!

Leave a comment