Learning Math and Coding with Robots

Linkbot Image Mindstorm Image Cursor Image
0x126-6-12y126-6-12
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: (0 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: (4 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: (8 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: (12 in, 0 in)
Current Angle: 90 deg
Wheel Radius:
Track Width:
in

Easter Egg Hunt
Problem Statement:
There are Easter Eggs at various locations on the grid and you want to get as many as possible. One strategy: From the initial position (0,0), driving to the nearest egg, then from the new position, drive to the next nearest egg, etc. until you reach the last egg. Click solution for example. Refresh for more problems.
/* Code generated by RoboBlockly v2.0 */
#include <linkbot.h>
#include <chplot.h>
CLinkbotI robot;
double radius = 1.75;
double trackwidth = 3.69;
CPlot plot;

// Describe this function...
void Sample_Set_Up_1() {
  plot.fillColor("#009900");
  plot.rectangle(-12, -12, 24, 24);
  plot.strokeColor(randcolor());
  plot.fillColor(randcolor());
  plot.ellipse(9, 4, 1, 1.5, 0);
  plot.strokeColor(randcolor());
  plot.fillColor(randcolor());
  plot.ellipse(9, -8, 1, 1.5, 0);
  plot.strokeColor(randcolor());
  plot.fillColor(randcolor());
  plot.ellipse(-5, -4, 1, 1.5, 0);
  plot.strokeColor(randcolor());
  plot.fillColor(randcolor());
  plot.ellipse(8, 6, 1, 1.5, 0);
  plot.strokeColor(randcolor());
  plot.fillColor(randcolor());
  plot.ellipse(-2, 5, 1, 1.5, 0);
  plot.strokeColor(randcolor());
  plot.fillColor(randcolor());
  plot.ellipse(-10, 6, 1, 1.5, 0);
  plot.strokeColor(randcolor());
  plot.fillColor(randcolor());
  plot.ellipse(3, -6, 1, 1.5, 0);
  plot.strokeColor(randcolor());
  plot.fillColor(randcolor());
  plot.ellipse(-10, -2, 1, 1.5, 0);
}

Sample_Set_Up_1();
robot.traceColor("#00FFFF", 4);
robot.setSpeed(30, radius);
robot.drivexyTo(-2, 5, radius, trackwidth);
robot.drivexyTo(-10, 6, radius, trackwidth);
robot.drivexyTo(-10, -2, radius, trackwidth);
robot.drivexyTo(-5, -4, radius, trackwidth);
robot.drivexyTo(3, -6, radius, trackwidth);
robot.drivexyTo(9, -8, radius, trackwidth);
robot.drivexyTo(9, 4, radius, trackwidth);
robot.drivexyTo(8, 6, radius, trackwidth);

plot.axisRange(PLOT_AXIS_XY, -12, 12);
plot.ticsRange(PLOT_AXIS_XY, 2);
plot.sizeRatio(1);
plot.plotting();
/* Code generated by RoboBlockly v2.0 */
#include <linkbot.h>
#include <chplot.h>
CLinkbotI robot;
double radius = 1.75;
double trackwidth = 3.69;
CPlot plot;

// Describe this function...
void Sample_Set_Up_2() {
  plot.fillColor("#009900");
  plot.rectangle(-12, -12, 24, 24);
  plot.strokeColor(randcolor());
  plot.fillColor(randcolor());
  plot.ellipse(8, -2, 1, 1.5, 0);
  plot.strokeColor("white");
  plot.text("(8,-2)", PLOT_TEXT_LEFT, 6.5, -1);
  plot.strokeColor(randcolor());
  plot.fillColor(randcolor());
  plot.ellipse(0, 9, 1, 1.5, 0);
  plot.strokeColor("white");
  plot.text("(0,9)", PLOT_TEXT_LEFT, -1.5, 10);
  plot.strokeColor(randcolor());
  plot.fillColor(randcolor());
  plot.ellipse(4, 4, 1, 1.5, 0);
  plot.strokeColor("white");
  plot.text("(4,4)", PLOT_TEXT_LEFT, 2.5, 5);
  plot.strokeColor(randcolor());
  plot.fillColor(randcolor());
  plot.ellipse(3, -11, 1, 1.5, 0);
  plot.strokeColor("white");
  plot.text("(3,-11)", PLOT_TEXT_LEFT, -2, -11.5);
  plot.strokeColor(randcolor());
  plot.fillColor(randcolor());
  plot.ellipse(3, -9, 1, 1.5, 0);
  plot.strokeColor("white");
  plot.text("(3,-9)", PLOT_TEXT_LEFT, 1.5, -8);
  plot.strokeColor(randcolor());
  plot.fillColor(randcolor());
  plot.ellipse(7, -11, 1, 1.5, 0);
  plot.strokeColor("white");
  plot.text("(7,-11)", PLOT_TEXT_LEFT, 5.5, -10);
  plot.strokeColor(randcolor());
  plot.fillColor(randcolor());
  plot.ellipse(-5, 8, 1, 1.5, 0);
  plot.strokeColor("white");
  plot.text("(-5,8)", PLOT_TEXT_LEFT, -6.5, 9);
  plot.strokeColor(randcolor());
  plot.fillColor(randcolor());
  plot.ellipse(-5, -9, 1, 1.5, 0);
  plot.strokeColor("white");
  plot.text("(-5,-9)", PLOT_TEXT_LEFT, -6.5, -8);
}

Sample_Set_Up_2();
robot.setSpeed(10, radius);
robot.traceColor("#00FFFF", 4);
robot.drivexyTo(4, 4, radius, trackwidth);
robot.drivexyTo(0, 9, radius, trackwidth);
robot.drivexyTo(-5, 8, radius, trackwidth);
robot.drivexyTo(8, -2, radius, trackwidth);
robot.drivexyTo(3, -9, radius, trackwidth);
robot.drivexyTo(3, -11, radius, trackwidth);
robot.drivexyTo(7, -11, radius, trackwidth);
robot.drivexyTo(-5, -9, radius, trackwidth);

plot.axisRange(PLOT_AXIS_XY, -12, 12);
plot.ticsRange(PLOT_AXIS_XY, 2);
plot.sizeRatio(1);
plot.plotting();
Blocks Save Blocks Load Blocks Show Ch Save Ch Workspace
Problem Statement:
There are Easter Eggs at various locations on the grid and you want to get as many as possible. One strategy: From the initial position (0,0), driving to the nearest egg, then from the new position, drive to the next nearest egg, etc. until you reach the last egg. Click solution for example. Refresh for more problems.

		
Rubbish bin
Time