-
Notifications
You must be signed in to change notification settings - Fork 0
/
hangman.basic
44 lines (44 loc) · 1.11 KB
/
hangman.basic
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
1 dim words$(13)
10 proclist
20 W=rnd(12)
30 A$=words$(W)
90 L=len(A$)
100 CORRECT=0
110 TRIES=0
115 cls
116 print A$
120 print tab(0,5) "The word has " L " letters"
130 print tab(0,6) "you have " (2*L) " tries"
140 repeat
150 print tab(10,7) "GUESS A LETTER " TRIES
155 print tab(0,8) " "
156 print tab(0,7) ""
160 G$=get$
180 P=0
190 repeat
200 P=instr(A$,G$,P+1)
210 if P != 0 then print tab(P+12,15) G$
220 if P != 0 then CORRECT=CORRECT +1
225 if P == L then p=0
230 until P == 0
240 TRIES=TRIES+1
250 print tab(0,0) "TRIES " TRIES
255 print tab(20,0) "CORRECT " CORRECT
260 until CORRECT >= L or TRIES == 2*L
270 if CORRECT >= L then print tab(10,19) "Congratulations " else print tab(10,19) "Sorry"
280 print tab(10,20) "The word was " A$
290 print tab(0,21) ""
400 defproc list
402 words$(1)="inquisition"
403 words$(2)="hello"
404 words$(3)="world"
405 words$(4)="carnivorous"
406 words$(5)="tenterhook"
407 words$(6)="decompression"
408 words$(7)="forthcoming"
409 words$(8)="nevertheless"
410 words$(9)="policewoman"
411 words$(10)="sophisticated"
412 words$(11)="guesstimate"
413 words$(12)="notwithstanding"
420 endproc