From: "Michael W. Ryder" <_mwryder@...> Date: 2008-08-28T11:30:22+09:00 Subject: Re: Having a difficult time with Case statements. Chris Bailey wrote: > Michael W. Ryder wrote: >> Chris Bailey wrote: >>> Thank you. >>> >>> Attachments: >>> http://www.ruby-forum.com/attachment/2623/startup.rb >>> >> Looking at your code it looks like you need to remove the first case >> statement and use something like a while loop. From what I can see it >> looks like when you select '2' it changes 'startstate' to 1 and then >> exits the case statement. An alternative is to set startstate in the >> main program and then call startUp with the current startstate -- i.e. x >> = startUp(startstate). Then test x to see if you want to call startUp >> again or exit the program. > > Wrapped a call to startUp() into the main game loop and made startstate > global....it's working like a charm now! =) Thanks a billion! > Glad to see you got it working. I think what you were trying to do would have worked in C as the case statements keep executing until they hit a break.