Bagels
Friday, June 13th, 2008 | Programs
For more including Author's Notes download the eBook pages with this program's code listing.
Number guessing games take many forms. There’s the famous high/low variation. There’s the warmer/colder, and then there’s games like Bagels. Bagels is almost a mini version of Mastermind™. When you make a guess you get one of three clues; “Fermi” you’ve got one correct digit in the correct place, “Pico” means you’ve got one correct digit in the wrong place, and “Bagles” means you’ve got nothing, a big zero. The goal, of course, is fermi-fermi-fermi, meaning you’ve guessed the 3 digit number.
Bagels is written by Joseph Larson based on a BASIC game by D. Resek and P. Rowe as found in ‘BASIC Computer Games’ edited by David H. Ahl.
2 Comments to Bagels
Because of the way ‘for’ works you can remove the ‘if (fermi != 0)’ and ‘if (pico != 0)’ lines and the program will still work in the same way, but be two lines shorter.
June 14, 2008
Woah, congrats on the spot, and so quick too, especially considering the links were broken. (Actually there were a number of problems with this post. Not a shining moment for me.)
But you’re right. You can remove those lines and the code will still function. Good catch.
I’m afraid of what you’d find if you combed over the rest of my code.
Leave a comment
Subscribe
Support Cymon's Games
Recent Comments
- Joe on Happy Thanksgiving
- Mike on Happy Thanksgiving
- Joe on NumbrixGenerator
- Joe on Book feedback
- Craig on Book feedback
- Craig on Numbrix
- Joe on Numbrix
- Joe on Here’s what else I was thinking
















June 14, 2008