I am trying to make a Greed game.  See attached for my code.

For some reason, when the roll method returns an array with three of 1s
or 5s such as:

[1, 1, 2, 1, 5]

I get an infinite loop printing

You roll [1, 1, 2, 1, 5]
You roll [1, 1, 2, 1, 5]
You roll [1, 1, 2, 1, 5]
...

I do not have this problem for any array that does not have three of 1s
or 5s.

Any idea why I get this problem?

Attachments:
http://www.ruby-forum.com/attachment/8349/about_extra_credit.rb


-- 
Posted via http://www.ruby-forum.com/.