Page 69 - Computer Class 04
P. 69
REPEAT Command
Sometimes, we need to repeat a set of commands again and again in the
same manner to make a drawing. One way of doing this is by giving all
the commands one after another in a repeated manner. The other way is
by giving the REPEAT command in LOGO. It has to be written in the
following way.
REPEAT number [commands] Press
Enter key or click on Execute command.
For example:
To draw a square, we have to give FD
50 RT 90 commands repeatedly four
times.
We can draw the same square using a
single REPEAT command as given
FD 50
below: RT 90
REPEAT 4 [FD 50 RT 90]
REPEAT 4 [FD 50 RT 90] press Enter key
or click on Execute command.
Practical Window
Try to draw the following.
8 To draw a circle – REPEAT 360 [FD 1 RT 1]
8 To draw a pentagon with 5 sides - REPEAT 5 [FD 70 RT 72]
8 To draw a heptagon with 7 sides - REPEAT 7 [FD 70 RT 57]
8 To draw an octagon with 8 sides - REPEAT 8 [FD 70 RT 45]
PRINT Command
The PRINT command is used to print text or number on the commander
window. It can also be used to print the results of arithmetic operations.
The short form of Print command is PR.
Computer-4 69