Learning Math and Coding with Robots

Linkbot Image Mindstorm Image Cursor Image
0x19216814412096724824y19216814412096724824
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: Background Image

Robot 1

Linkbot
Mindstorm
Initial Position:
( in, in)
Initial Angle:
deg
Current Position: (32 in, 0 in)
Current Angle: 90 deg
Wheel Radius:
Track Width:
in

Robot 2

Linkbot
Mindstorm
Initial Position:
( in, in)
Initial Angle:
deg
Current Position: (96 in, 0 in)
Current Angle: 90 deg
Wheel Radius:
Track Width:
in

Robot 3

Linkbot
Mindstorm
Initial Position:
( in, in)
Initial Angle:
deg
Current Position: (168 in, 0 in)
Current Angle: 90 deg
Wheel Radius:
Track Width:
in

Robot 4

Linkbot
Mindstorm
Initial Position:
( in, in)
Initial Angle:
deg
Current Position: (72 in, 0 in)
Current Angle: 90 deg
Wheel Radius:
Track Width:
in

Fastest Team
Problem Statement:

Your 3-robots team is doing a biking - swimming - running race. The length of each activity and the robots' speeds are listed in the table. Find the order (which robot does which activity - no repeat) that would finish the entire race the fastest. The 6 possibilities are under the Function tab. 

/* Code generated by RoboBlockly v2.0 */
/* Problem Statement: 
    
    
    Your 3-robots team is doing a biking - swimming - running
    race. The length of each activity and the robots'
    speeds are listed in the table. Find the order (which robot
    does which activity - no repeat) that would finish the
    entire race the fastest. The 6 possibilities are under the
    Function tab. 
    */
#include <linkbot.h>
CLinkbotI robot1;
double radius1 = 1.75;
CLinkbotI robot2;
double radius2 = 1.75;
double trackwidth1 = 3.69;
double trackwidth2 = 3.69;
CLinkbotI robot3;
double radius3 = 1.75;

// Describe this function...
void my_1_bike__2__swim__3_run() {
  robot1.setSpeed(50, radius1);
  robot2.setSpeed(50, radius2);
  robot1.drivexyToNB(168, 0, radius1, trackwidth1);
  robot2.drivexyTo(32, 0, radius2, trackwidth2);
  robot1.moveWait();
  robot1.turnLeftNB(90, radius1, trackwidth1);
  robot2.turnRight(90, radius2, trackwidth2);
  robot1.moveWait();
  // comment
  robot1.setSpeed(12, radius1);
  robot3.setSpeed(14, radius3);
  robot2.setSpeed(10, radius2);
  robot1.driveDistance(192, radius1);
  robot3.driveDistance(150, radius3);
  robot2.driveDistance(120, radius2);
}
double trackwidth3 = 3.69;

// Describe this function...
void my_1_bike__3__swim__2_run() {
  robot1.setSpeed(50, radius1);
  robot3.setSpeed(50, radius3);
  robot2.setSpeed(50, radius2);
  robot1.drivexyToNB(168, 0, radius1, trackwidth1);
  robot3.drivexyToNB(32, 0, radius3, trackwidth3);
  robot2.drivexyTo(96, 0, radius2, trackwidth2);
  robot1.moveWait();
  robot1.turnLeftNB(90, radius1, trackwidth1);
  robot3.turnRightNB(90, radius3, trackwidth3);
  robot2.turnRight(90, radius2, trackwidth2);
  // comment
  robot1.setSpeed(12, radius1);
  robot2.setSpeed(20, radius2);
  robot3.setSpeed(12, radius3);
  robot1.driveDistance(192, radius1);
  robot2.driveDistance(150, radius2);
  robot3.driveDistance(120, radius3);
}

// Describe this function...
void my_2_bike__3_swim__1_run() {
  robot3.setSpeed(50, radius3);
  robot2.setSpeed(50, radius2);
  robot3.drivexyToNB(168, 0, radius3, trackwidth3);
  robot2.drivexyTo(96, 0, radius2, trackwidth2);
  robot3.turnLeftNB(90, radius3, trackwidth3);
  robot2.turnRight(90, radius2, trackwidth2);
  // comment
  robot3.setSpeed(16, radius3);
  robot2.setSpeed(20, radius2);
  robot1.setSpeed(8, radius1);
  robot3.driveDistance(192, radius3);
  robot2.driveDistance(150, radius2);
  robot1.driveDistance(120, radius1);
}

// Describe this function...
void my_2_bike__1__swim__3_run() {
  robot1.setSpeed(50, radius1);
  robot3.setSpeed(50, radius3);
  robot2.setSpeed(50, radius2);
  robot1.drivexyToNB(96, 0, radius1, trackwidth1);
  robot3.drivexyToNB(169, 0, radius3, trackwidth3);
  robot2.drivexyTo(32, 0, radius2, trackwidth2);
  robot1.moveWait();
  robot1.turnLeftNB(90, radius1, trackwidth1);
  robot3.turnLeftNB(90, radius3, trackwidth3);
  robot2.turnRight(90, radius2, trackwidth2);
  // comment
  robot3.setSpeed(16, radius3);
  robot1.setSpeed(18, radius1);
  robot2.setSpeed(10, radius2);
  robot3.driveDistance(192, radius3);
  robot1.driveDistance(150, radius1);
  robot2.driveDistance(120, radius2);
}

// Describe this function...
void my_3_bike__1__swim__2_run() {
  robot1.setSpeed(50, radius1);
  robot3.setSpeed(50, radius3);
  robot1.drivexyToNB(96, 0, radius1, trackwidth1);
  robot3.drivexyTo(32, 0, radius3, trackwidth3);
  robot1.turnLeftNB(90, radius1, trackwidth1);
  robot3.turnRight(90, radius3, trackwidth3);
  // comment
  robot2.setSpeed(18, radius2);
  robot1.setSpeed(19, radius1);
  robot3.setSpeed(12, radius3);
  robot2.driveDistance(192, radius2);
  robot1.driveDistance(150, radius1);
  robot3.driveDistance(120, radius3);
}

// Describe this function...
void my_3_bike__2__swim__1_run() {
  robot2.setSpeed(18, radius2);
  robot3.setSpeed(14, radius3);
  robot1.setSpeed(8, radius1);
  robot2.driveDistance(192, radius2);
  robot3.driveDistance(150, radius3);
  robot1.driveDistance(120, radius1);
}

// The team order with the fastest time is:
my_3_bike__1__swim__2_run();
Blocks Save Blocks Load Blocks Show Ch Save Ch Workspace
Problem Statement:

Your 3-robots team is doing a biking - swimming - running race. The length of each activity and the robots' speeds are listed in the table. Find the order (which robot does which activity - no repeat) that would finish the entire race the fastest. The 6 possibilities are under the Function tab. 


		
Rubbish bin
Time