|
3. Commands > More LOGO Commands 3.2. COMMANDS | More Command 1 | More Command 2 | More Command 3 | 3.2.1. More Command 1 Command: <FENCE> Function: At times, you might give a command for the turtle to move which will take it beyond the screen. The <FENCE> command creates a fence around the screen so that the turtle cannot go beyond the screen. Syntax: FENCE <Enter> Example: FENCE <Enter> RT 80 <Enter> FD 600 <Enter> Result: A message Turtle out of bounds appears and the figure is displayed, truncated at the right end of the screen.
3.2.2. More Command 2 Command: <WRAP> Function: The <WRAP> command allows the turtle to reappear on the other end of the screen once the edge is reached. Syntax: WRAP <Enter> Example: WRAP <Enter> RT 80 <Enter> FD 600 <Enter> Result: When the screen is in Wrap Mode, as the edge of the screen is reached, turtle appears at the other end, drawing the balance part of picture.
3.2.3. More Command 3 Command: Nested <REPEAT> (Repeat within Repeat) Function: The REPEAT command when given inside another REPEAT command. Example 1: REPEAT 2 [REPEAT 4 [FD 40 RT 90] RT 90] <Enter> Result: Two squares are shown in the figure below. Figure for Example 1 Example 2: REPEAT 2 [REPEAT 6 [FD 80 RT 60] RT 120] <Enter> Figure for Example 2 Example 3: REPEAT 2 [REPEAT 8 [FD 30 BK 30 RT 45] PU FD 40 PD] <Enter> Figure for Example 3 Example 4: REPEAT 12 [REPEAT 6 [FD 40 LT 60] RT 30] <Enter> Figure for Example 4 |
©2005 FINA'S CO.
HOME
|