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 | |
Units: | US Customary | Metric |
Background: |
![]() |
|
|
|
/* Code generated by RoboBlockly v2.0 */ #include <linkbot.h> double variable; CLinkbotI robot; double radius = 1.75; double trackwidth = 3.69; variable = randint(1, 100); printf("variable is %g \n", variable); if (variable % 2 == 0 && variable > 50) { robot.drivexyTo(0, 5, radius, trackwidth); } else if (variable % 2 != 0 && variable < 50) { robot.drivexyTo(5, 5, radius, trackwidth); } else { robot.drivexyTo(5, 0, radius, trackwidth); }
Problem Statement: Fill in the "if - else if - else" blocks so that the linkbot moves to (0, 5) when a random integer between 1 and 100 is even and greater than 50, to (5, 5) if the variable is odd and less than 50, and otherwise to (5, 0). |
||||||||||||