The goal is to write a program that eats all the slices of a banana from a plate.
If played solo, the player will write and execute the code. If played with two players, one player writes and reads the code, while the other player performs the actions.
Place 3-5 slices of banana on a plate.
How many banana slices do you want your program to eat?
The answer to this question determines the values in your initialization assignment block.
What steps do you take to eat a single slice of banana?
Write each step on a blank tile. Each of this steps is a function.
Once written, place each function to eat a slice into a code block. This will form the body of your loop
How long will you keep eating slices?
The answer to this question will help you determine the loop condition.
Use the operator (not equal to ≠), for children who do not yet understand the 'greater than' operator.
Arrange the blocks as follows:
Initialize 'k' with the number of slices on the plate:
Enter the condition loop. Is the value of 'k' greater than 0?
If TRUE follow the arrows to the loop body.
Once in the loop body, call the functions to eat a banana slice.
Follow the direction arrows to enter the decrement assignment. Update the number of banana slices in the plate.
Then re-enter the loop condition. Iterate through the loop while the condition evaluates to TRUE.
The game ends when the loop condition 'k > 0' is no longer met, that is, when there are 0 slices left to eat on the plate.
When 'k' is not greater than 0, exit the loop and END the program.