Grid: | ||
Tics Lines: |
|
Width
px
|
Hash Lines: |
|
Width
px
|
Labels: |
|
Font
px
|
Trace Lines: | ||
Robot 1: |
|
Width
px
|
Robot 2: |
|
Width
px
|
Robot 3: |
|
Width
px
|
Robot 4: |
|
Width
px
|
Axes: | x-axis | y-axis | Show Grid |
Grid: | 24x24 inches | 36x36 inches | 72x72 inches |
96x96 inches | 192x192 inches | ||
Quad: | 4 quadrants | 1 quadrant | Hardware |
Units: | US Customary | Metric |
Background: |
![]() |
|
|
|
The createSquare function will draw a square. Use this function to draw two squares of length 4: Square 1 is centered at (3, 3) and Square 2 is at (9, 12). For a challenge, trace only the two squares.
/* Code generated by RoboBlockly v2.0 */ #include <linkbot.h> CLinkbotI robot; double radius = 1.75; double trackwidth = 3.69; int count; // Describe this function... void createSquare() { robot.traceOff(); robot.driveDistance(2, radius); robot.turnRight(90, radius, trackwidth); robot.traceOn(); count = 0; while(count < 4) { robot.driveDistance(2, radius); robot.turnRight(90, radius, trackwidth); robot.driveDistance(2, radius); count = count + 1; } } robot.traceOff(); robot.drivexyTo(3, 3, radius, trackwidth); robot.traceOn(); createSquare(); robot.traceOff(); robot.drivexyTo(9, 12, radius, trackwidth); robot.traceOn(); createSquare();
Problem Statement: The createSquare function will draw a square. Use this function to draw two squares of length 4: Square 1 is centered at (3, 3) and Square 2 is at (9, 12). For a challenge, trace only the two squares. |
|||||||||||