-
Notifications
You must be signed in to change notification settings - Fork 3
/
GUESS_Y3.bas
40 lines (40 loc) · 953 Bytes
/
GUESS_Y3.bas
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
10 DIM M(885):K=885
20 FOR Q=102 TO 987
30 M(Q-102)=Q
40 NEXT Q
50 RANDOMIZE VAL(RIGHT$(TIME$,2))
60 IF K=0 THEN 330
70 IF K=-1 THEN 340
80 P=INT(RND*K)
90 G=M(P)
100 X=INT(G/100)
110 Y=INT(G/10-X*10)
120 Z=G-X*100-Y*10
130 IF X=0 OR X=Y OR X=Z OR Y=Z THEN 80
140 PRINT
150 PRINT"WHAT'S ABOUT";G;"?"
160 INPUT "?A,?B ";A0,B0
170 L=K:K=-1
180 FOR J=0 TO L
190 A=INT(M(J)/100)
200 B=INT(M(J)/10-A*10)
210 C=M(J)-A*100-B*10
220 IF A=0 OR A=B OR A=C OR B=C THEN 310
230 M=0:N=0
240 IF A=X THEN M=M+1
250 IF B=Y THEN M=M+1
260 IF C=Z THEN M=M+1
270 IF X=B OR X=C THEN N=N+1
280 IF Y=A OR Y=C THEN N=N+1
290 IF Z=A OR Z=B THEN N=N+1
300 IF M=A0 AND N=B0 THEN 370
310 NEXT J
320 GOTO 60
330 PRINT "DOES IT'S RIGHT?------------------";M(0):GOTO 350
340 PRINT"THAT'S IMPOSSIBLE!YOU ARE WRONG!"
350 INPUT "DO YOU WANT TO PLAY AGAIN(Y/N)";D$
360 IF D$="Y" OR D$="y" THEN 50 ELSE END
370 K=K+1
380 M(K)=M(J)
390 GOTO 310