-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathARCHPROB.ACH
51 lines (41 loc) · 871 Bytes
/
ARCHPROB.ACH
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File: rd3.ach
null main
active : FALSE
key_pressed : UNDEFINED
response : UNDEFINED
turn : 0
methods
'AFFIRM': {
response := ( ((key_pressed := key) leftfrom 1) within "yY" )
write key_pressed
response
}
'PLAY': {
turn +:= 1
write "Turn: ", turn
if turn = 10 then active := FALSE
}
'RESET': {
active := TRUE
write "Game Reset"
}
'START': {
writes "Load old game? "
if 'AFFIRM' -> main then {
writes "Name of file? "
'LOAD STATE' -> system
read -> system
write "Loaded."
}
else
'RESET'
while active do 'PLAY'
writes "Save game? "
if 'AFFIRM' -> main then {
writes "Save to file: "
'SAVE STATE' -> system
read -> system
write "Saved."
}
}
end