forked from bgri/m100LE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
M100LE_v0l_final.DO
222 lines (219 loc) · 6.12 KB
/
M100LE_v0l_final.DO
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
10 'WORDLE FOR THE TANDY M100
11 'ADAPTED BY BRAD GRIER
12 'BLOG.BRADGRIER.COM
13 'UNCOMMENTED VERSION AND SUPPORTING FILES
14 'AT : https://github.com/bgri/m100LE
15 '
16 AD$=DATE$:MD=0
17 IF MD=1 THEN GOSUB 8150
20 db=0:VR$="v0.l"
21 if RF=1 THEN AD$=DATE$
23 CU=41:CO=110
24 GU$="_____":BG$=".....":GW$=BG$
25 DL=400
29 G1=41:W1=G1+7
30 G2=81:W2=G2+7
31 G3=121:W3=G3+7
32 G4=161:W4=G4+7
33 G5=201:W5=G5+7
34 G6=241:W6=G6+7
35 A1$="ABCDEFGHIJKLM": A2$="NOPQRSTUVWXYZ"
37 DIM SO$(6):FOR I=1 TO 6:SO$(I)=BG$:NEXT I
40 '
41 CLS
42 PRINT @ G1 ,GU$:PRINT @ W1,GW$
43 PRINT @ G2 ,GU$:PRINT @ W2,GW$
44 PRINT @ G3 ,GU$:PRINT @ W3,GW$
45 PRINT @ G4 ,GU$:PRINT @ W4,GW$
46 PRINT @ G5 ,GU$:PRINT @ W5,GW$
47 PRINT @ G6 ,GU$:PRINT @ W6,GW$
48 PRINT @ 16,"-m100le-":PRINT @ 214, A1$:PRINT @ 254, A2$
49 PRINT @ 68,"|":PRINT @ 108,"|":PRINT @ 148,"|":PRINT @ 188,"|":PRINT @ 228,"|":PRINT @ 268,"|"
50 ON ERROR GOTO 9000
65 WF$="WL20XX.DO"
68 DIM WD$(5)
69 DIM DA(12)
70 '
73 IF RF<>1 THEN DY=0
76 BL$=" ":US$="_"
77 GN=1
78 TW$="":TM$=""
79 N=0:I=0:R=0:C=0
80 '
82 DATA 31,28,31,30,31,30,31,31,30,31,30,31
83 FOR I = 1 TO 12: READ DA(I):NEXT I
84 GOSUB 8300
90 '
100 '
299 '
300 '
400 '
410 GOSUB 6000
500 '
1000 'MAIN LOOP
1010 GOSUB 7000
1015 '
1020 GOSUB 7100
1999 GOTO 1000
2000 '
3000 '
3010 CO=110
3020 IF CC<=1 THEN PRINT @ CO,"HMMM...": FOR NQ= 1 TO DL: NEXT NQ: PRINT @ CO, " "
3030 IF CC=2 THEN PRINT @ CO,"OK...": FOR NQ= 1 TO DL: NEXT NQ: PRINT @ CO, " "
3040 IF CC=3 THEN PRINT @ CO,"NICE": FOR NQ= 1 TO DL: NEXT NQ: PRINT @ CO, " "
3060 IF CC>=4 THEN PRINT @ CO,"WELL DONE": FOR NQ= 1 TO DL: NEXT NQ: PRINT @ CO, " "
3070 RETURN
4000 '
5000 '
5010 '
5020 CLS:CU=16:PRINT @ CU,"-m100le-":CU=CU-3
5025 IF RF=1 THEN PRINT @ 29,"RAND("+STR$(DY)+")" ELSE PRINT @ 40-LEN(WF$), WF$
5026 PRINT @ 80-LEN(AD$),AD$
5028 PRINT @ 120-LEN(VR$),VR$
5029 PRINT @ 160-LEN(STR$(DY)),DY
5030 FOR I = 1 TO 6: CU=CU+40: FOR J=1 TO 5
5033 IF ASC(MID$(SO$(I),J,1))>=65 THEN MID$(SO$(I),J,1)="*"
5035 NEXT J
5037 PRINT @CU,I;"- ";SO$(I): NEXT I
5040 CU=65:GOSUB 8100:PRINT @ CU,GN;:PRINT @ CU+2, "/6 ":GOSUB 8100
5050 PRINT @41, "WORDLE FOR"
5060 PRINT @81, "m100"
5100 K$=INKEY$: IF K$="" THEN GOTO 5100 ELSE
5500 CLS:CU=16:PRINT @ CU,"-m100le-"
5560 SV=1:GOTO 8910
6000 '
6001 '
6002 GOSUB 8100:PRINT @ 72, "LOADING":GOSUB 8100
6010 OPEN WF$ FOR INPUT AS #1
6015 N=1
6020 LINE INPUT #1,TW$
6025 IF EOF(1) THEN GOTO 6050
6030 IF N<> DY THEN: N=N+1: GOTO 6020
6040 '
6050 CLOSE #1
6060 FOR I=1 TO 5: WD$(I) = MID$(TW$,I,1):NEXT I
6065 PRINT @ 72, " ": PRINT @ 80-LEN(STR$(DY)),DY:if db=1 then tw$="HIPPY"
6070 RETURN
6999 GOTO 10000
7000 '
7001 '
7002 '
7005 N=LEN(TM$)
7010 PRINT @ CU+N,BL$:IF N<5 THEN PRINT @ CU+N,US$
7012 K$ = INKEY$: IF K$="" GOTO 7010
7015 X=ASC(K$)
7020 IF X=8 OR X=13 THEN :K$="":RETURN
7022 IF X<65 THEN K$=""
7025 IF X>90 AND X<97 THEN K$=""
7026 IF X>122 THEN K$=""
7040 IF K$="" THEN GOTO 7010
7050 IF ASC(K$)>=97 THEN K$=CHR$(X-32)
7060 RETURN
7070 '
7100 '
7105 IF X=8 THEN GOSUB 7200
7107 IF X=13 THEN GOTO 7300
7110 TM$=LEFT$(TM$,4)
7120 N=LEN(TM$)
7130 TM$=TM$+K$
7180 PRINT @ CU, TM$
7185 '
7190 '
7199 RETURN
7200 '
7210 '
7220 '
7230 N=LEN(TM$)
7240 IF N>=1 THEN: TM$=LEFT$(TM$,N-1)
7250 PRINT @ CU, SPACE$(N+1):PRINT @ CU,TM$
7280 RETURN
7300 '
7302 '
7310 '
7315 IF LEN(TM$)< 5 THEN GOTO 7000
7320 IF TM$=TW$ THEN WN=1: GW$=TM$: GOSUB 8100: PRINT @ 134, " CONGRATS! ": GOSUB 8100: FOR I = 1 TO DL: NEXT I: GOTO 7360
7325 ''
7330 GW$=BG$
7335 H$=TM$
7340 FOR I = 1 TO 5
7341 IF MID$(H$,I,1) = MID$(TW$,I,1) THEN MID$(GW$,I,1) = MID$(TW$,I,1)
7342 IF MID$(H$,I,1) = MID$(TW$,I,1) THEN MID$(H$,I,1) = "!" :CC=CC+1
7344 NEXT I
7346 FOR I = 1 TO 5
7348 IF MID$(H$,I,1)="!" THEN GOTO 7358
7350 FOR J = 1 TO 5
7351 IF MID$(H$,J,1)="!" THEN GOTO 7356
7353 IF MID$(H$,J,1) = MID$(TW$,I,1) THEN MID$(GW$,J,1) = "?":CC=CC+1
7356 NEXT J
7358 NEXT I
7360 IF GN<=1 THEN: PRINT @ W1, GW$;: SO$(1)=GW$: CU=G2
7362 IF GN=2 THEN: PRINT @ W2, GW$;: SO$(2)=GW$: CU=G3
7364 IF GN=3 THEN: PRINT @ W3, GW$;: SO$(3)=GW$: CU=G4
7366 IF GN=4 THEN: PRINT @ W4, GW$;: SO$(4)=GW$: CU=G5
7368 IF GN=5 THEN: PRINT @ W5, GW$;: SO$(5)=GW$: CU=G6
7370 IF GN=6 THEN: PRINT @ W6, GW$;: SO$(6)=GW$
7375 IF WN=1 THEN GOTO 8900
7380 GOSUB 7400
7382 GOSUB 3000:CC=1
7384 IF WN=1 THEN GOTO 8900
7394 GW$=BG$
7395 IF GN=6 THEN GOTO 8900
7399 GN=GN+1: TM$="":GOTO 7190
7400 '
7405 '
7410 FOR I = 1 TO 5
7411 T=ASC(MID$(TM$,I,1)):T=T-64
7415 IF T<=13 THEN IF MID$(A1$,T,1) <> "*" THEN: IF MID$(TM$,I,1) = MID$(GW$,I,1) THEN MID$(A1$,T,1)="*" ELSE MID$(A1$,T,1)=MID$(GW$,I,1)
7420 IF T>13 THEN IF MID$(A2$,T-13,1) <> "*" THEN: IF MID$(TM$,I,1) = MID$(GW$,I,1) THEN MID$(A2$,T-13,1) = "*" ELSE MID$(A2$,T-13,1) = MID$(GW$,I,1)
7460 ''
7480 NEXT I
7485 GOSUB 8800
7490 PRINT @ 214, A1$
7495 PRINT @ 254, A2$
7499 RETURN
7500 '
7510 '
7570 '
7580 '
7999 GOTO 10000
8000 '
8100 '
8110 Q=PEEK(63048): IF Q=0 THEN POKE 63048,1 ELSE POKE63048,0
8120 RETURN
8150 '
8160 IF MD<>1 THEN RETURN
8170 CLS: PRINT @ 8, "DATE (MM/DD/YY):";
8180 LINE INPUT "";AD$
8190 RETURN
8300 '
8301 '
8301 '
8310 '
8320 CM=VAL(LEFT$(AD$,2))
8322 '
8325 '
8335 IF RF<>1 THEN:FOR I = 1 TO CM-1: DY=DY+DA(I): NEXT I: DY=DY+VAL(MID$(AD$,4,2))
8340 '
8350 MID$(WF$,5) = RIGHT$(AD$,2)
8360 '
8365 IF RF=1 THEN PRINT @ 36,"RAND" ELSE PRINT @ 40-LEN(WF$), WF$
8399 RETURN
8800 '
8860 RETURN
8900 '
8905 IF GN>=6 AND WN<>1 THEN GOSUB 8100: PRINT @136, " SORRY! ": GOSUB 8100: 'CANADIAN 'EH?'
8910 IF SV=1 THEN CO=96
8912 PRINT @ CO,"[A]GAIN?":PRINT @ CO+40,"[R]ANDOM?":PRINT @ CO+80,"[S]OCIAL?":PRINT @ CO+120,"[Q]UIT?"
8915 '
8920 K$ = INKEY$: IF K$="" GOTO 8920
8925 IF K$="a" OR K$="A" THEN CLEAR:CLS: GOTO 10
8930 IF K$="r" OR K$="R" THEN CLEAR:CLS: RF=1:RT=VAL(RIGHT$(TIME$,2)): FOR I=1 TO RT:DY=FIX(RND(RT)*365):NEXT I:MD=0:GOTO 20
8935 IF K$="s" OR K$="S" THEN GOTO 5000
8938 IF K$="q" OR K$="Q" THEN MENU
8940 PRINT @ CO-2," ":PRINT @ CO+40," ":PRINT @ CO+80," ":PRINT @ CO, "ENDING...";:FOR I = 1 TO DL: NEXT I: CLS: END
9000 '
9005 '
9010 IF ERR=52 THEN CLS: PRINT "PROGAM STOP": PRINT "DATA FILE NOT FOUND (";WF$")": END
9200 gosub 8100:PRINT @ 70, ERR;"-";ERL:gosub 8100:END
9999 GOTO 9999
10000 PRINT "ERROR - YOU SHOULD NOT HAVE GOTTEN SO FAR":STOP