First solution, using a class definition RandomGuess