====== Step 3.3: Coding the loops ====== If you remember the flow chart from [[tutorial1-tetris:step2.4|Step 2.4]], there we designed the program flow in several loops that are nested into one another. * The inner loop, reponsive for moving the current piece in the playfield, let's call it the //update loop//. One iteration in this loop is one downward movement of a piece. * The middle loop, or the //game loop//, which is looping during the gameplay. It is responsive for "sending" the pieces after one another. One iteration within this loop is one piece falling down. * The outer loop, the //program loop//. One iteration within this loop is a game. Here is how the three loops are nested (in pseudo code): REM program loop WHILE REM game loop REPEAT REM update loop REPEAT UNTIL UNTIL ENDWHILE The actual code will follow the idea of the above pseudo-code. I suggest we start with the update loop on the next page. <- step_3.2.5|Previous page ^ start|Tetris tutorial ^ step_3.3.1|Next page ->