Logo (programming language): Difference between revisions

Content deleted Content added
m got rid of <CODE> around "and", then decided to just dump it completely
MSWLogo graphics added-Ex7 changed to make an static image-
Line 29:
LEFT 90
FORWARD 100</code>
[[image:Ex1.jpg|Basic Square]]<br>
 
This would draw a square with sides 100 units long ( but the turtle still has to turn LT 90 to be in the starting position).
 
Line 38:
FORWARD 100 RIGHT 120 FORWARD 100</code>
 
[[image:Ex2.jpg|Basic Triangle]]<br>
Would draw a triangle.
 
Line 53 ⟶ 54:
PENDOWN
FD 10
[[image:Ex3.jpg|Dotted Line]]<br>
 
====Example 4: Loops====
Line 77 ⟶ 79:
END
</code>
[[image:Ex5.jpg|Basic Chair]]<br>
 
If you are using the editor you must exit from it, and the new word is saved into the availabe vocabulary, but will be lost when LOGO is exited.
Line 94 ⟶ 97:
</code>
 
CS CHAIR WAIT 200 ERASECHAIR
There were two new instructions- which are easier to use than explain. Thats the spirit of LOGO. <br>
 
====Example 7: Parameters- giving the word changeable information ====
Line 104 ⟶ 109:
END
Try
CS REPEAT 509 [HOME CHAIR 20050 HOMERT 20 CHAIR 100 WAIT 200 HOME50 ERASECHAIRRT 20]
 
[[image:Ex7.jpg|Pattern]]<br>
 
There were two new instructions- which are easier to use than explain. Thats the spirit of LOGO. <br>
If you do need help. Type <code>HELP</code>, or <code>HELP "HOME</code> ( note the single quote mark.)
 
Line 142 ⟶ 148:
 
spiral 10
[[image:Ex8.jpg|Recursive Spiral]]<br>
 
===Data===
Line 293 ⟶ 300:
A sundial plate must be calculated for its latitude using the formula
x= arctan( sin(latitude)*tan(HourDiff * 15 ) )
The Gnomon Angle = 90 - latitude.<br>
[[image:Ex10_38N.jpg|Sundial in Berkeley, California]]<br>
This dial is set for 38N, the latitude of Berkeley, California- the home of UCBLogo. A small correction should be made for Longitude.
 
===MSWLogo extensions===