From: Lloyd Linklater Date: 2008-10-31T23:40:55+09:00 Subject: Re: Ruby Mastermind Game Steve Jones wrote: > Hi all, > > Im really stuck with a project. I need to create a mastermind program > using ruby. The details are in the following link; > > http://cs105.updatelog.org/2008/10/09/lab-8-branches-and-loops-part-ii/#more-298 > > It is exercise 2 at the bottom. > > Any help or sample code would be great > > Cheers!! Well, you know how to get the random number, so that is easy enough. You just store the last guess and if the new guess is closer to correct than the last one, you are warmer. Continue until they get it right. Going to 10k should be guessed in no more than 14 tries. -- Posted via http://www.ruby-forum.com/.