Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Adding one last conditional in a random-number guessing game

by ww (Bishop)
on Feb 22, 2014 at 12:57 UTC ( #1075824=note: print w/ replies, xml ) Need Help??


in reply to Adding one last conditional in a random-number guessing game

So you want the record of $program_guesses carried over from game to game? You appear to confirm that in your Re^2: Adding one last conditional in a random-number guessing gamein response to hdb's Re: Adding one last conditional in a random-number guessing game.

And do you want the guess record carried over from execution to execution of the game?

That would entail keeping your record of the guesses -- hash, array or list -- in a (tied-)file
      ...and would mean the game could never be "played" more than 10 times!

Update: that is "never" without making the record inaccessible to the script (in effect, deleting the record).

Are you sure you understood your homework assignment correctly? Could it be that the user should not be allowed to guess the same number twice in the course of a single game?

Come, let us reason together: Spirit of the Monastery


Comment on Re: Adding one last conditional in a random-number guessing game
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1075824]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2014-12-20 05:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls