Guessing Game V2.0

0 views
Skip to first unread message

Rathan Haran

unread,
Oct 26, 2009, 6:22:45 PM10/26/09
to learnpython
Hey Everyone,

I was just thinking about the Guessing Game from Chapter 1, and wanted to implement a more optimal strategy for making guesses to get to the secret answer (rather than just guessing randomly higher and lower).  Here's a little program in python that I've been toying with to do that (special thanks to Chapters 2 & 3 and Chad).  It essentially figures out what the best guess should be, and spits it back into the game to get to the right answer.  It gets it between 6 and 8 tries, depending on how close the initial guess is.  

See you guys tonight.

Rathan

--
www.wixity.com
www.webinometry.com
guessing_game_v1.0
Reply all
Reply to author
Forward
0 new messages