in reply to Pseduo code planning
Do you really want to exit the program if they get the card wrong? Sounds like you'll have a lot of very short games to me. A do/while loop is close to a natural fit for this, since you want to execute the shuffle once first before testing, although I think it'll make more sense to move the user input and testing part from the while condition and into the do block.
do { shuffle and display card; read input; } while (input correct); exit(0);
Of course, since the program as described could be written in so few lines utilizing a shuffling module (e.g., Algorithm::Numerical::Shuffle since it came up earlier today), you might as well use a label and a goto :^)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Pseudo code planning
by kutsu (Priest) on Jun 08, 2003 at 02:16 UTC |