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

But can I do it without creating a hash?

I can do it :D But I would just use a hash anyway :)

  • Comment on Re^3: Adding one last conditional in a random-number guessing game

Replies are listed 'Best First'.
Re^4: Adding one last conditional in a random-number guessing game
by Anonymous Monk on Feb 22, 2014 at 11:17 UTC
    Can you point me how then (I mean without using a hash)

      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

      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?