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
52
53
54
|
-
|
-
|
!
-
|
|
-
|
|
!
-
|
!
| #const Q_MAX 12 onkey goto *Pressed
title "Start!"
font msgothic, 36
Pushed = "" QNumber = 0 Index = 0 sdim Question, 32, Q_MAX Question(0) = "RED", "GREEN", "BLUE", "YELLOW"
Question(4) = "DOG", "CAT", "BIRD", "GIRAFFE"
Question(8) = "HOTSOUP", "COMPUTER", "BYTE", "PROGRAM"
*Main
if Pushed != "" : gosub *Check
gosub *Draw
stop
*Pressed
if (('A'<=iparam)&(iparam<='Z'))|(('0'<=iparam)&(iparam<='9'))|(iparam=='-') {
Pushed = strf("%c", iparam)
} else {
Pushed = ""
}
goto *Main
*Check
if Pushed == strmid(question(QNumber), Index, 1) {
title "Good!"
Index++
if Index == strlen(question(QNumber)) {
QNumber = (QNumber + 1) \ Q_MAX
Index = 0
}
} else {
title "Miss!"
}
return
*Draw
redraw 0
color 255, 255, 255 : boxf
pos 2, 2 : color 192, 192, 192
mes Question(QNumber)
pos 0, 0 : color 255
mes strmid(Question(QNumber), 0, Index)
pos ginfo_mesx*(Index > 0), 0 : color
mes strmid(Question(QNumber), Index, strlen(question(QNumber)) - Index)
redraw 1
return
|