--0016361e8878d0e0aa0476f783c3
Content-Type: text/plain; charset=ISO-8859-1

The integer you want is the random number + 1.  Just save the rand value.

On Wed, Oct 28, 2009 at 12:44 AM, Brian Geds <uforacer / hotmail.com> wrote:

> Hey I got it working now I need help with one last thing. The game is
> suppose to take the number of the dice and put them into points, and
> this gives you, your score. the numbers are suppose to be like this one
>  0, two  , and so oh. How can I do this?
>
>
> # roll or pass
> #
> # A Ruby dice game.  Each turn you can play it safe and keep your score,
> # or roll again to rack up points.  But watch out!  A roll of 1 could
> cost
> # you everything!
>
>
> # dice face rows
>
> frame   +-----+\n"
> blank   |     |\n"
> center   |  *  |\n"
> left  |*    |\n"
> right  |    *|\n"
> both  |*   *|\n"
> # dice faces
>
> one   rame + blank + center + blank + frame
> two  rame + left + blank + right + frame
> three  rame + left + center + right + frame
> four  rame + both + blank + both + frame
> five  rame + both + center + both + frame
> six  rame + both*3 + frame
> weird   rame + blank*3 + frame
> faces  one, two, three, four, five, six]
> points  
> puts 'Would you like the roll or pass?'
> user_turn  ets.chomp()
> while (user_turn ! pass') do
>  result1 aces[(rand(6))]
>  result2 aces[(rand(6))]
>  puts result1
>  puts result2
>   if (result1 ! aces[0]) and (result2 ! aces[0])
>  puts 'current score is'
>   puts 'Would you like to roll again?'
>  user_turn  ets.chomp
>   else
>  break
> end
> end
> --
> Posted via http://www.ruby-forum.com/.
>
>

--0016361e8878d0e0aa0476f783c3--