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

Control/!Control/Dir/Sparkle/Auto_doors/Auto_doors

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/Sparkle/Auto_doors/Auto_doors
Read OK:
File size: 0120 bytes
Load address: 0000
Exec address: 0000
File contents
; automatic doors
; pressure pad in 8

draw main "main"
draw 1 "open" "close"

repeat
if input 8 on then call open
if input 8 off then call close
until input 1 on
stop

define open
output 1 on
wait input 8 off
enddefine

define close
wait time 200
output 1 off
wait input 8 on
enddefine

00000000  3b 20 61 75 74 6f 6d 61  74 69 63 20 64 6f 6f 72  |; automatic door|
00000010  73 0a 3b 20 70 72 65 73  73 75 72 65 20 70 61 64  |s.; pressure pad|
00000020  20 69 6e 20 38 0a 0a 64  72 61 77 20 6d 61 69 6e  | in 8..draw main|
00000030  20 22 6d 61 69 6e 22 0a  64 72 61 77 20 31 20 22  | "main".draw 1 "|
00000040  6f 70 65 6e 22 20 22 63  6c 6f 73 65 22 0a 0a 72  |open" "close"..r|
00000050  65 70 65 61 74 0a 69 66  20 69 6e 70 75 74 20 38  |epeat.if input 8|
00000060  20 6f 6e 20 74 68 65 6e  20 63 61 6c 6c 20 6f 70  | on then call op|
00000070  65 6e 0a 69 66 20 69 6e  70 75 74 20 38 20 6f 66  |en.if input 8 of|
00000080  66 20 74 68 65 6e 20 63  61 6c 6c 20 63 6c 6f 73  |f then call clos|
00000090  65 0a 75 6e 74 69 6c 20  69 6e 70 75 74 20 31 20  |e.until input 1 |
000000a0  6f 6e 0a 73 74 6f 70 0a  0a 64 65 66 69 6e 65 20  |on.stop..define |
000000b0  6f 70 65 6e 0a 6f 75 74  70 75 74 20 31 20 6f 6e  |open.output 1 on|
000000c0  0a 77 61 69 74 20 69 6e  70 75 74 20 38 20 6f 66  |.wait input 8 of|
000000d0  66 0a 65 6e 64 64 65 66  69 6e 65 0a 0a 64 65 66  |f.enddefine..def|
000000e0  69 6e 65 20 63 6c 6f 73  65 0a 77 61 69 74 20 74  |ine close.wait t|
000000f0  69 6d 65 20 32 30 30 0a  6f 75 74 70 75 74 20 31  |ime 200.output 1|
00000100  20 6f 66 66 0a 77 61 69  74 20 69 6e 70 75 74 20  | off.wait input |
00000110  38 20 6f 6e 0a 65 6e 64  64 65 66 69 6e 65 0a 0a  |8 on.enddefine..|
00000120