Azure Jane Lunatic (Azz) 🌺 (
azurelunatic) wrote2002-01-29 11:50 pm
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
teriyaki chicken
Am not big fan of chicken. Votania was serving anyway. Made up some of FatherSir's famous secret sauce & baked it in that. Delicious. Everyone agreed. Nephew ate some of his peas on my directives to "Pick one up, put it in your mouth, chew it, swallow it." And I couldn't get him to accept a do/while loop: do: (predefined routine: eat peas) while: (peas still on plate).
Yum teriyaki chicken.
Yum teriyaki chicken.
Do/while loop
/*
Name: Jeffrey Lowe
Section: 5CB
Assignment: Get Nephew to eat his peas
Class: Eating 101
Description: Using an infinite while loop, we feed Nephew until he's either full or there are no more peas. If neither of the previous two are true, then proceed with the feeding!
*/
//always continues
while(1)
{
//beginning of if loop to check for if there is still food AND Nephew isn't full.
//If either of these is true, then break.
if(Nephew != FULL && (checkpeas()))
{
//using the object "hand", you can pick up a utensil
pick_up_fork(hand);
//using yet another object, "head", open the mouth
open_mouth(head);
//pretty nifty trick; place_food_in_mouth() actually returns a food object, which is
//what eat() needs. Just be sure it's peas.
eat(place_food_in_mouth(peas));
//more tricky stuff. Swallow was designed to be polymorphic, to enable swallowing
//many objects; however, the programmer must be careful that Nephew swallows
//the peas in this instance, and not the fork.
swallow(food);
}//end if
else break;
}//end while
Tsk tsk tsk....such newbies :p
Re: Do/while loop