|
Drive the robot forward 5 units when a random integer between 1 and 100 is greater than 50. Otherwise, drive the robot backwards 5 units. |
Drive the robot forward 5 units when a random integer between 1 and 100 is less than 30. If the integer is greater than 80, drive the robot forward 3 units. Otherwise, drive the robot backwards 7 units. |
During each iteration of the loop, the code increases the size of the robot and moves it forward by 0.2 inches. It then gets the robot's (x,y) coordinates and checks if x equals 6. If so, it changes the model to a brown cat. It also checks if x equals 12, and if so, it changes the model to a dog. |
The code prompts the user to click in the sky, trees, or water to move either the helicopter, bird, or boat. When the user clicks, the code stores the (x,y) coordinates of the click location, draws a dot there, and then uses a conditional "if-else if" code block to check the y coordinate of the click to determine where the user clicked and move the appropriate robot to that point. (See the lesson on Prompt the User to Click in a Rectangle for more info.) |
Grid Size: S M L | Simple View: | MinView: |
|
Coord: x-axis y-axis | Grid Lines: x-axis y-axis | |||
Grid: | 12x12 inches | 24x24 inches | 36x36 inches | |
72x72 inches | 96x96 inches | 192x192 inches | ||
1x1 inches | 2x2 inches | Fraction: | ||
xy-Range: | ||||
|
||||
|
||||
Quad: | 1 Quadrant | 4 Quadrants | 1&4 Quadrants | |
Units: | US Customary | Metric | Ruler: |
Labels: |
|
|
|
Font
px
|
|
Tics Lines: |
|
Width
px
|
Hash Lines: |
|
Width
px
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
|
|||||||||||
|
|||||||||||