Learning CS and Math with Robotics

CSP Unit 3 Lesson 8.3a

Piano MinView
Linkbot Image Mindstorm Image
Grid Lines:
Tics Lines:
Width px
Hash Lines:
Width px
Font px
Trace Lines:
Robot 1:
Width px
Robot 2:
Width px
Robot 3:
Width px
Robot 4:
Width px
Simple View: Grid Size: S M L
CSP Unit 3 Lesson 8.3a

The pre-placed code moves the robot to the point x = 10, y = 10 (with the trace off) and then calls the "traceSquare" function (defined at the bottom of the code), sending it a parameter value of 14. When the traceSquare function receives the value of 14, it inserts it into its "sideLength" parameter and then executes the function's code to trace the square. There's one bug in the code, however. Run the pre-placed code to see what happens, and then find and fix the bug. (See the hint if you get stuck.)

Load Blocks
Workspace Show Ch Save File Console

Rubbish bin