mercredi 25 janvier 2017

Hidden cheat code to test game Ruby

In Ruby, how do I add a hidden cheat to my game to display the random number already generated to test it?

def generate_number

return randomNo = 1 + rand(1000)

end

def play_game

    $noOfGuesses=0 
    $gameCount+=1 


number = generate_number 
cheat = [number]




Aucun commentaire:

Enregistrer un commentaire