in reply to Re^3: Adding one last conditional in a random-number guessing game
in thread Adding one last conditional in a random-number guessing game

Can you point me how then (I mean without using a hash)
  • Comment on Re^4: Adding one last conditional in a random-number guessing game

Replies are listed 'Best First'.
Re^5: Adding one last conditional in a random-number guessing game
by hdb (Monsignor) on Feb 22, 2014 at 13:26 UTC

    As you can only have 10 games, create an array with the numbers 1 to 10, shuffle it, see List::Util, and then pop the numbers to be guessed

Re^5: Adding one last conditional in a random-number guessing game
by Anonymous Monk on Feb 22, 2014 at 11:19 UTC

    Can you point me how then (I mean without using a hash)

    Sure, the three basic types are scalars, hashes and arrays -- if you don't want to use a hash, use an array :)

      But, as pointed before, it is better and easier to do it with a hash than with an array. So my question to the OP is: why would you want to avoid a hash?