From: Super Goat Date: 2011-05-08T14:08:34+09:00 Subject: Re: Lets play a guessing game. (how to code this better?) Thanks again for everyones input and thanks to Jesus for explaining and providing examples for using a method in my code. >And now, the OP is frightenend of functional programming No, this sounds like fun. I'll work my way there eventually. So attached is my updated version. As you can see I also added a # of 'guesses' variable that counts the number of attempts and then exits when you hit the max. That took me a little while to figure out, but I am pleased that I got it. I was thinking of asking if the player would like to play again and then figuring out how to restart the whole thing but I wasn't sure how to do this. How can I make prompt to "Play again?" and when answered "Yes" restart, whether the person wins or loses (or if "No" just exits)? Or is the way my code is written make this impossible? Attachments: http://www.ruby-forum.com/attachment/6181/meth_100guess.rb -- Posted via http://www.ruby-forum.com/.