Home » Archimedes archive » Acorn User » AU 1994-08.adf » !Education_Education » Control/!Control/Dir/Logo/Answers1

Control/!Control/Dir/Logo/Answers1

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » AU 1994-08.adf » !Education_Education
Filename: Control/!Control/Dir/Logo/Answers1
Read OK:
File size: 04ED bytes
Load address: 0000
Exec address: 0000
File contents
The language used in Logo programs varies significantly, not only in the commands, but in the distance the numbers represent. However, the answers given here should work with most versions of Logo with a minimum of alteration. 

The construction for REPEAT varies, and so two versions are given. 

The solution are given as direct instructions ie no attempt is made to create a procedure as this process varies greatly between different versions of Logo. Each solution assumes the turtle is facing North ie towards the top of the screen.

1. Square
FORWARD 100
RIGHT 90
FORWARD 100
RIGHT 90
FORWARD 100
RIGHT 90
FORWARD 100
RIGHT 90

or

REPEAT 4
 FORWARD 100
 RIGHT 90
END

or

REPEAT 4 [FORWARD 100 RIGHT 90]

2. Square turned through 45�

LEFT 45
REPEAT 4
 FORWARD 100
 RIGHT 90
END
RIGHT 45

or

LEFT 45
REPEAT 4 [FORWARD 100 RIGHT 90]
RIGHT 45


3. Circle

REPEAT 360
 FORWARD 1
 RIGHT 1
END

or

REPEAT 360 [FORWARD 1 RIGHT 1]


4.Rectangle

REPEAT 2
 FORWARD 50
 RIGHT 90
 FORWARD 100
 RIGHT 90
END

or

REPEAT 2 [FORWARD 50 RIGHT 90 FORWARD 100 RIGHT 90]


5.Hexagon

REPEAT 6
 FORWARD 70
 RIGHT 60
END

or

REPEAT 6 [FORWARD 70 RIGHT 60]


6. Polygon (n=number of sides)

REPEAT n 
 FORWARD 50
 RIGHT 360/n
END

or

REPEAT n [FORWARD 50 RIGHT 360/n]


00000000  54 68 65 20 6c 61 6e 67  75 61 67 65 20 75 73 65  |The language use|
00000010  64 20 69 6e 20 4c 6f 67  6f 20 70 72 6f 67 72 61  |d in Logo progra|
00000020  6d 73 20 76 61 72 69 65  73 20 73 69 67 6e 69 66  |ms varies signif|
00000030  69 63 61 6e 74 6c 79 2c  20 6e 6f 74 20 6f 6e 6c  |icantly, not onl|
00000040  79 20 69 6e 20 74 68 65  20 63 6f 6d 6d 61 6e 64  |y in the command|
00000050  73 2c 20 62 75 74 20 69  6e 20 74 68 65 20 64 69  |s, but in the di|
00000060  73 74 61 6e 63 65 20 74  68 65 20 6e 75 6d 62 65  |stance the numbe|
00000070  72 73 20 72 65 70 72 65  73 65 6e 74 2e 20 48 6f  |rs represent. Ho|
00000080  77 65 76 65 72 2c 20 74  68 65 20 61 6e 73 77 65  |wever, the answe|
00000090  72 73 20 67 69 76 65 6e  20 68 65 72 65 20 73 68  |rs given here sh|
000000a0  6f 75 6c 64 20 77 6f 72  6b 20 77 69 74 68 20 6d  |ould work with m|
000000b0  6f 73 74 20 76 65 72 73  69 6f 6e 73 20 6f 66 20  |ost versions of |
000000c0  4c 6f 67 6f 20 77 69 74  68 20 61 20 6d 69 6e 69  |Logo with a mini|
000000d0  6d 75 6d 20 6f 66 20 61  6c 74 65 72 61 74 69 6f  |mum of alteratio|
000000e0  6e 2e 20 0a 0a 54 68 65  20 63 6f 6e 73 74 72 75  |n. ..The constru|
000000f0  63 74 69 6f 6e 20 66 6f  72 20 52 45 50 45 41 54  |ction for REPEAT|
00000100  20 76 61 72 69 65 73 2c  20 61 6e 64 20 73 6f 20  | varies, and so |
00000110  74 77 6f 20 76 65 72 73  69 6f 6e 73 20 61 72 65  |two versions are|
00000120  20 67 69 76 65 6e 2e 20  0a 0a 54 68 65 20 73 6f  | given. ..The so|
00000130  6c 75 74 69 6f 6e 20 61  72 65 20 67 69 76 65 6e  |lution are given|
00000140  20 61 73 20 64 69 72 65  63 74 20 69 6e 73 74 72  | as direct instr|
00000150  75 63 74 69 6f 6e 73 20  69 65 20 6e 6f 20 61 74  |uctions ie no at|
00000160  74 65 6d 70 74 20 69 73  20 6d 61 64 65 20 74 6f  |tempt is made to|
00000170  20 63 72 65 61 74 65 20  61 20 70 72 6f 63 65 64  | create a proced|
00000180  75 72 65 20 61 73 20 74  68 69 73 20 70 72 6f 63  |ure as this proc|
00000190  65 73 73 20 76 61 72 69  65 73 20 67 72 65 61 74  |ess varies great|
000001a0  6c 79 20 62 65 74 77 65  65 6e 20 64 69 66 66 65  |ly between diffe|
000001b0  72 65 6e 74 20 76 65 72  73 69 6f 6e 73 20 6f 66  |rent versions of|
000001c0  20 4c 6f 67 6f 2e 20 45  61 63 68 20 73 6f 6c 75  | Logo. Each solu|
000001d0  74 69 6f 6e 20 61 73 73  75 6d 65 73 20 74 68 65  |tion assumes the|
000001e0  20 74 75 72 74 6c 65 20  69 73 20 66 61 63 69 6e  | turtle is facin|
000001f0  67 20 4e 6f 72 74 68 20  69 65 20 74 6f 77 61 72  |g North ie towar|
00000200  64 73 20 74 68 65 20 74  6f 70 20 6f 66 20 74 68  |ds the top of th|
00000210  65 20 73 63 72 65 65 6e  2e 0a 0a 31 2e 20 53 71  |e screen...1. Sq|
00000220  75 61 72 65 0a 46 4f 52  57 41 52 44 20 31 30 30  |uare.FORWARD 100|
00000230  0a 52 49 47 48 54 20 39  30 0a 46 4f 52 57 41 52  |.RIGHT 90.FORWAR|
00000240  44 20 31 30 30 0a 52 49  47 48 54 20 39 30 0a 46  |D 100.RIGHT 90.F|
00000250  4f 52 57 41 52 44 20 31  30 30 0a 52 49 47 48 54  |ORWARD 100.RIGHT|
00000260  20 39 30 0a 46 4f 52 57  41 52 44 20 31 30 30 0a  | 90.FORWARD 100.|
00000270  52 49 47 48 54 20 39 30  0a 0a 6f 72 0a 0a 52 45  |RIGHT 90..or..RE|
00000280  50 45 41 54 20 34 0a 20  46 4f 52 57 41 52 44 20  |PEAT 4. FORWARD |
00000290  31 30 30 0a 20 52 49 47  48 54 20 39 30 0a 45 4e  |100. RIGHT 90.EN|
000002a0  44 0a 0a 6f 72 0a 0a 52  45 50 45 41 54 20 34 20  |D..or..REPEAT 4 |
000002b0  5b 46 4f 52 57 41 52 44  20 31 30 30 20 52 49 47  |[FORWARD 100 RIG|
000002c0  48 54 20 39 30 5d 0a 0a  32 2e 20 53 71 75 61 72  |HT 90]..2. Squar|
000002d0  65 20 74 75 72 6e 65 64  20 74 68 72 6f 75 67 68  |e turned through|
000002e0  20 34 35 b0 0a 0a 4c 45  46 54 20 34 35 0a 52 45  | 45...LEFT 45.RE|
000002f0  50 45 41 54 20 34 0a 20  46 4f 52 57 41 52 44 20  |PEAT 4. FORWARD |
00000300  31 30 30 0a 20 52 49 47  48 54 20 39 30 0a 45 4e  |100. RIGHT 90.EN|
00000310  44 0a 52 49 47 48 54 20  34 35 0a 0a 6f 72 0a 0a  |D.RIGHT 45..or..|
00000320  4c 45 46 54 20 34 35 0a  52 45 50 45 41 54 20 34  |LEFT 45.REPEAT 4|
00000330  20 5b 46 4f 52 57 41 52  44 20 31 30 30 20 52 49  | [FORWARD 100 RI|
00000340  47 48 54 20 39 30 5d 0a  52 49 47 48 54 20 34 35  |GHT 90].RIGHT 45|
00000350  0a 0a 0a 33 2e 20 43 69  72 63 6c 65 0a 0a 52 45  |...3. Circle..RE|
00000360  50 45 41 54 20 33 36 30  0a 20 46 4f 52 57 41 52  |PEAT 360. FORWAR|
00000370  44 20 31 0a 20 52 49 47  48 54 20 31 0a 45 4e 44  |D 1. RIGHT 1.END|
00000380  0a 0a 6f 72 0a 0a 52 45  50 45 41 54 20 33 36 30  |..or..REPEAT 360|
00000390  20 5b 46 4f 52 57 41 52  44 20 31 20 52 49 47 48  | [FORWARD 1 RIGH|
000003a0  54 20 31 5d 0a 0a 0a 34  2e 52 65 63 74 61 6e 67  |T 1]...4.Rectang|
000003b0  6c 65 0a 0a 52 45 50 45  41 54 20 32 0a 20 46 4f  |le..REPEAT 2. FO|
000003c0  52 57 41 52 44 20 35 30  0a 20 52 49 47 48 54 20  |RWARD 50. RIGHT |
000003d0  39 30 0a 20 46 4f 52 57  41 52 44 20 31 30 30 0a  |90. FORWARD 100.|
000003e0  20 52 49 47 48 54 20 39  30 0a 45 4e 44 0a 0a 6f  | RIGHT 90.END..o|
000003f0  72 0a 0a 52 45 50 45 41  54 20 32 20 5b 46 4f 52  |r..REPEAT 2 [FOR|
00000400  57 41 52 44 20 35 30 20  52 49 47 48 54 20 39 30  |WARD 50 RIGHT 90|
00000410  20 46 4f 52 57 41 52 44  20 31 30 30 20 52 49 47  | FORWARD 100 RIG|
00000420  48 54 20 39 30 5d 0a 0a  0a 35 2e 48 65 78 61 67  |HT 90]...5.Hexag|
00000430  6f 6e 0a 0a 52 45 50 45  41 54 20 36 0a 20 46 4f  |on..REPEAT 6. FO|
00000440  52 57 41 52 44 20 37 30  0a 20 52 49 47 48 54 20  |RWARD 70. RIGHT |
00000450  36 30 0a 45 4e 44 0a 0a  6f 72 0a 0a 52 45 50 45  |60.END..or..REPE|
00000460  41 54 20 36 20 5b 46 4f  52 57 41 52 44 20 37 30  |AT 6 [FORWARD 70|
00000470  20 52 49 47 48 54 20 36  30 5d 0a 0a 0a 36 2e 20  | RIGHT 60]...6. |
00000480  50 6f 6c 79 67 6f 6e 20  28 6e 3d 6e 75 6d 62 65  |Polygon (n=numbe|
00000490  72 20 6f 66 20 73 69 64  65 73 29 0a 0a 52 45 50  |r of sides)..REP|
000004a0  45 41 54 20 6e 20 0a 20  46 4f 52 57 41 52 44 20  |EAT n . FORWARD |
000004b0  35 30 0a 20 52 49 47 48  54 20 33 36 30 2f 6e 0a  |50. RIGHT 360/n.|
000004c0  45 4e 44 0a 0a 6f 72 0a  0a 52 45 50 45 41 54 20  |END..or..REPEAT |
000004d0  6e 20 5b 46 4f 52 57 41  52 44 20 35 30 20 52 49  |n [FORWARD 50 RI|
000004e0  47 48 54 20 33 36 30 2f  6e 5d 0a 0a 0a           |GHT 360/n]...|
000004ed