12-04-2009, 02:14 AM
(This post was last modified: 12-04-2009, 02:15 AM by Brainless Control.)
(12-03-2009, 04:18 PM)Master of The Universe Wrote: +Alright thanks man
(12-03-2009, 11:01 AM)Xenocide Wrote:You see that, those two loops are almost the same.Code:while(option<1 || option>4);
while(option!=4)
You could easy put that all in one loop
Code:while(option > 4) {
switch(option) {
// cases 1 to 4
// case 1:
// do();
// break;
default:
return 1;
}
}
The default part would execute on every number that's not in the range from 1-4, so no need for option < 1 and the second while loop.
So you can use the default to call the selection menu again.