CS 111 - 9/6/16 Chapter 3 - Using "Turtle Drawings" instead of text/string manipulation Flow of Control - determine which statement get executed next Points of Confusion - assignment statements look very similar to algebraic statements - However, not all of the rules apply in the same manner. For example: x = x + 1 The above is invalid in algebra, but EXTREMELY common in programming In Programming, the normal "Flow of Control" is sequential execution - when finished with statement X then execute statement X+1 x = 5 y = x + 2 x = 7 print x print y As a statement is executed, the result in dependent on that statement and the current values stored in memory. Sometimes drawing pictures may help in understanding the execution of a program. x: 5 7 y: 7 To show and understand flow of control with sequential execution, I like to use Turtle Drawings Assume we have a world, in the world, turtle exist each turtle has a pen attached to its back as the turtle moves around, it drawing a line with its pen The basic turtle commands include: moving forward turning The Turtle operations are discussed in Chapter 17 of the text, the back inside cover of the text, in the JES Functions section of JES It is often a good idea to write programs using "Increamental Development" - which means to write a small section of the program, verify the section is correct before moving on to program the next section of the program