RoboBlockly for Learning Coding and Math with Robots

0x36302418126y36302418126
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:

Robot 1

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

Robot 2

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

Robot 3

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

Robot 4

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

Mix Solutions
Problem Statement:
The pre-placed blocks draw the animation of the pouring of solution from the red container into the blue container. The red container contains salt water that is 15% salt by mass. The larger blue container contains 3 cups of salt water that is 40% salt by mass. How much of the salt water from the red container must be added to create a mixture that is 25% salt by mass? Edit the first block and set "amountRedSolution" to the correct number.
/* Code generated by RoboBlockly v2.0 */
#include <chplot.h>
double amountRedSolution;
double i;
double j;
double k;
double totalVolume;
double percentSalt;
CPlot plot;

amountRedSolution = 4.5;
// The amountRedSolution is used in later code
plot.strokeColor("black");
for(i = 1; i <= 13; i++) {
  plot.backgroundColor("white");
  plot.fillColor("#66ffff");
  plot.rectangle(24, 6, 7, 10);
  plot.noStrokeColor();
  plot.fillColor("#3366ff");
  plot.rectangle(24, 6, 7, 3);
  plot.strokeColor("black");
  plot.text("3 cups of 40%", PLOT_TEXT_LEFT, 22, 3);
  plot.fillColor("brown");
  // with every loop, the rectangle position changes
  plot.regularPolygon(i + 7, i + 6, 4, 6, 0);
  delaySeconds(0.05);
}
// we use j now because we've already used i
for(j = 1; j >= -40; j -= 5) {
  plot.backgroundColor("white");
  plot.fillColor("#66ffff");
  plot.rectangle(24, 6, 7, 10);
  plot.noStrokeColor();
  plot.fillColor("#3366ff");
  plot.rectangle(24, 6, 7, 3);
  plot.strokeColor("black");
  plot.fillColor("brown");
  // the square rotates by the angle which changes
  plot.regularPolygon(20, 19, 4, 6, j);
  delaySeconds(0.01);
}
// we use amountRedSolution to pour the right amount
num k_inc = 0.5;
if (0 > amountRedSolution) {
  k_inc = -k_inc;
}
k = 0;
while(k_inc >= 0 ? k <= amountRedSolution : k >= amountRedSolution) {
  plot.fillColor("red");
  plot.noStrokeColor();
  plot.circle(24, 16, 4);
  plot.fillColor("white");
  plot.circle(23.5, 15.5, 4.3);
  plot.fillColor("brown");
  plot.strokeColor("black");
  plot.regularPolygon(20, 19, 4, 6, -40);
  plot.fillColor("#66ffff");
  plot.rectangle(24, 6, 7, 10);
  // displaying the contents of the container
  plot.text(amountRedSolution, PLOT_TEXT_LEFT, 23, 21);
  plot.text("cups 15% ", PLOT_TEXT_LEFT, 26.5, 21);
  plot.noStrokeColor();
  plot.fillColor("#3366ff");
  plot.rectangle(24, 6, 7, 3);
  plot.fillColor("red");
  // the height of the liquid rises with each loop
  plot.rectangle(24, 9, 7, k);
  delaySeconds(0.05);
  k += k_inc;
}
delaySeconds(1);
plot.backgroundColor("white");
plot.strokeColor("black");
plot.fillColor("#66ffff");
plot.rectangle(24, 6, 7, 10);
plot.fillColor("#6600cc");
plot.rectangle(24, 6, 7, amountRedSolution + 3);
totalVolume = amountRedSolution + 3;
plot.text(totalVolume, PLOT_TEXT_LEFT, 22, 22);
plot.text("cups total", PLOT_TEXT_LEFT, 25, 22);
plot.grid(PLOT_OFF);
percentSalt = double((3 * 0.4 + amountRedSolution * 0.15))/(amountRedSolution + 3);
percentSalt = percentSalt * 100;
plot.text(percentSalt, PLOT_TEXT_LEFT, 22, 28);
plot.text("% salt", PLOT_TEXT_LEFT, 25, 28);

plot.label(PLOT_AXIS_XY, "");
plot.grid(PLOT_OFF);
plot.tics(PLOT_AXIS_XY, PLOT_OFF);
plot.axis(PLOT_AXIS_XY, PLOT_OFF);
plot.axisRange(PLOT_AXIS_XY, 0, 36);
plot.ticsRange(PLOT_AXIS_XY, 6);
plot.sizeRatio(1);
plot.plotting();
Blocks Save Blocks Load Blocks Show Ch Save Ch Workspace
Problem Statement:
The pre-placed blocks draw the animation of the pouring of solution from the red container into the blue container. The red container contains salt water that is 15% salt by mass. The larger blue container contains 3 cups of salt water that is 40% salt by mass. How much of the salt water from the red container must be added to create a mixture that is 25% salt by mass? Edit the first block and set "amountRedSolution" to the correct number.

		
Time