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 r; double d; CLinkbotI robot1; double radius1 = 1.75; CLinkbotI robot2; double radius2 = 1.75; double trackwidth1 = 3.69; double trackwidth2 = 3.69; int count; // r is the radius of the circular roundabout r = 18; d = 2 * (M_PI * (double(r)/360)); robot1.setSpeed(8, radius1); robot2.setSpeed(8, radius2); robot1.driveDistanceNB(18, radius1); robot2.driveDistance(18, radius2); robot1.turnRightNB(90, radius1, trackwidth1); robot2.turnRight(90, radius2, trackwidth2); robot1.moveWait(); count = 0; while(count < 90) { robot1.driveDistanceNB(d, radius1); robot1.turnLeftNB(1, radius1, trackwidth1); robot2.driveDistanceNB(d, radius2); robot2.turnLeftNB(1, radius2, trackwidth2); count = count + 1; } robot1.turnRightNB(90, radius1, trackwidth1); robot2.turnRight(90, radius2, trackwidth2); robot1.driveDistanceNB(18, radius1); robot2.driveDistance(18, radius2); robot1.moveWait();
Problem Statement: The pre-placed blocks drive the two linkbots to the entrances and attempt at the turn. Modify the existing blocks and add in new ones to navigate the two linkbots around the roundabout to reach their destinations (Robot1 goes from red to green entrance. Robot2 goes from orange to blue.) |
||||||||||||