Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
25
Task/ABC-problem/Commodore-BASIC/abc-problem-1.basic
Normal file
25
Task/ABC-problem/Commodore-BASIC/abc-problem-1.basic
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
10 W$ = "A" : GOSUB 100
|
||||
20 W$ = "BARK" : GOSUB 100
|
||||
30 W$ = "BOOK" : GOSUB 100
|
||||
40 W$ = "TREAT" : GOSUB 100
|
||||
50 W$ = "COMMON" : GOSUB 100
|
||||
60 W$ = "SQUAD" : GOSUB 100
|
||||
70 W$ = "CONFUSE" : GOSUB 100
|
||||
80 END
|
||||
90 REM ********************************
|
||||
100 B$="BOXKDQCPNAGTRETGQDFSJWHUVIANOBERFSLYPCZM"
|
||||
110 FOR I=1 TO LEN(W$)
|
||||
120 : BL = LEN(B$)
|
||||
130 : FOR J=1 TO BL STEP 2
|
||||
140 : C$=MID$(B$,J,1): D$=MID$(B$,J+1,1)
|
||||
150 : X$=MID$(W$,I,1)
|
||||
160 : IF C$<>X$ AND D$<>X$ THEN GOTO 190
|
||||
170 : B$ = LEFT$(B$,J-1)+RIGHT$(B$,BL-J-1)
|
||||
180 : GOTO 210
|
||||
190 : NEXT J
|
||||
200 : IF J>BL-1 THEN GOTO 240
|
||||
210 NEXT I
|
||||
220 PRINT W$" -> YES"
|
||||
230 RETURN
|
||||
240 PRINT W$" -> NO"
|
||||
250 RETURN
|
||||
Loading…
Add table
Add a link
Reference in a new issue