Escolar Documentos
Profissional Documentos
Cultura Documentos
FOLDER
CLICK ON ‘ACCEPT’
THIS IS THE EDITOR
SCREEN , WHERE YOU KEY
IN YOUR PROGRAM .
0 0
X-AXIS 800
Y-AXIS
600
How to Create a Line
• Define the begin point (1) and
the end point(2)
• Begin Point: x1, y1
• End Point: x2, y2
• The Command to Draw the Line :
– Line x1, y1, x2, y2
– Example: Line 40, 50, 100, 200
How to Create Shapes:
• A Rectangle: define the point in the
upper-left corner(1) and the point
in the lower-right corner(2).
– Rectangle x1, y1, x2, y2
– Example: Rectangle 40, 50, 100, 200
• A Circle: define it like a rectangle.
The circle is drawn inside that
rectangle.
– Circle x1, y1, x2, y2
– Example: Circle 40, 50, 100, 200
// To draw a line , define the begin point and end point .
// Line x - coordinate of begin point , y - coordinate of begin
point ,
// x - coordinate of end point , y - coordinate of end point
End
Robot Basic Commands & their
Meaning
• rLocate x,y • Places the robot simulator
• on the screen at the x, y
coordinates.
• rTurn angle
• Turns the robot at the angle
• specified (it defaults to
• rForward pointing up).
pixels • Moves the robot forward
• the number of pixels.
• End • Ends the program.
• ALL ROBOT COMMANDS BEGIN WITH AN ‘ R ’
A Sample Program
Meaning of Each
Command
Places robot at
coordinates 100 for x,
and 200 for y.
Robot turns 90 degrees
(right).
Robot moves forward
500 pixels.
Robot turns 180
degrees (halfway
arount).
Robot moves forward
500 pixels.
Program ends.
THE ROBOT SIMULATOR
DURING THE PROGRAM RUN .
Save
N e w File File
Open File
Cut Paste
C opy
Other Buttons on the Toolbar You Should
Know:
Undo Last Find and
Change Replace
Text
Find Text
Print your
program
Run Program
Show Terminal
Screen
Here’s a Sample Program with
Comments:
// defines
a comment,
which the
program
ignores
Rectang
le
Circle
Line
line 0,0,800,600
line 800,0,0,600