From: tamouse mailing lists Date: 2013-04-17T10:26:25+09:00 Subject: Re: Getting infinite loop from specific array I suggest writing some unit tests for your methods, and stepping through them with the debugger. On Tue, Apr 16, 2013 at 7:23 PM, Vincent Stowbunenko wrote: > 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/. >