Barobo
PortalSign In
HomeShopTutorialsFree CurriculumHour of Code
RoboBlockly for Learning Math and Coding

Piano
Linkbot Image Mindstorm Image
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
Labels: x-axis y-axis Show Grid
Grid: 12x12 inches 24x24 inches 36x36 inches
72x72 inches 96x96 inches 192x192 inches
Quad: 4 Quadrants 1 Quadrant 1&4 Quadrants
Units: US Customary Metric
Background: Background Image

Robot 1

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

Robot 2

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

Robot 3

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

Robot 4

0
S
M
L
Initial Position:
( in, in)
Initial Angle:
deg
Current Position: (18 in, 0 in)
Current Angle: 90 deg
Wheel Radius:
Track Width:
in
Draw an Umbrella from Above
/* Code generated by RoboBlockly v2.0 */
#include <chplot.h>
double i;
double x;
double y;
double j;
double xRan;
double yRan;
CPlot plot;

plot.backgroundColor("#ccffff");
plot.noStrokeColor();
plot.fillColor("red");
plot.circle(18, 18, 10);
plot.fillColor("#ccffff");
for(i = 1; i <= 8; i++) {
  x = 18 + 18 * cos(deg2rad((45 * i)));
  y = 18 + 18 * sin(deg2rad((45 * i)));
  plot.circle(x, y, 10);
}
plot.strokeColor("black");
plot.point(18, 18);
plot.fillColor("#3366ff");
plot.strokeColor("#3366ff");
plot.strokeWidth(1);
for(j = 1; j <= 25; j++) {
  xRan = randint(1, 35);
  yRan = randint(1, 35);
  plot.circle(xRan, yRan, 0.4);
  plot.regularPolygon(xRan, yRan + 0.4, 3, 0.4, 0);
}
plot.grid(PLOT_OFF);

plot.axisRange(PLOT_AXIS_XY, 0, 36);
plot.ticsRange(PLOT_AXIS_XY, 6);
plot.sizeRatio(1);
plot.plotting();
/* Code generated by RoboBlockly v2.0 */
#include <chplot.h>
double i;
double x;
double y;
double j;
double xRan;
double yRan;
CPlot plot;

plot.backgroundColor("#ccffff");
plot.noStrokeColor();
plot.fillColor("red");
plot.circle(18, 18, 10);
plot.fillColor("#ccffff");
for(i = 1; i <= 8; i++) {
  x = 18 + 18 * cos(deg2rad((45 * i)));
  y = 18 + 18 * sin(deg2rad((45 * i)));
  plot.circle(x, y, 10);
}
plot.strokeColor("black");
plot.point(18, 18);
plot.fillColor("#3366ff");
plot.strokeColor("#3366ff");
plot.strokeWidth(1);
for(j = 1; j <= 25; j++) {
  xRan = randint(1, 35);
  yRan = randint(1, 35);
  plot.circle(xRan, yRan, 0.4);
  plot.triangle(xRan + 0.4, yRan, xRan - 0.4, yRan, xRan, yRan + 0.7);
}
plot.grid(PLOT_OFF);

plot.axisRange(PLOT_AXIS_XY, 0, 36);
plot.ticsRange(PLOT_AXIS_XY, 6);
plot.sizeRatio(1);
plot.plotting();
Load Blocks
Hardware
LArduino
Workspace Show Ch Save File
Problem Statement:
The pre-placed blocks draw a funny looking umbrella. Fix the x and y variables in the loop and the count block so that the umbrella created has 8 vertices and 8 sides of equal size, as shown in the initial prompt. You will need to change the values inside the cos and sin functions, and the number of times the program loops. You also need to add 25 raindrops in random locations. Do this using a loop.

		
Rubbish bin
Time