-
Notifications
You must be signed in to change notification settings - Fork 0
/
KLOTSKI.BAS
56 lines (55 loc) · 1.4 KB
/
KLOTSKI.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
' Klotski | IchigoJam BASIC 1.3+
' Copyright (c) 2020 Keiichi Shiga (BALLOON | FU-SEN)
' The MIT License (MIT) - https://mit.balloon.net.eu.org/#2020
POKE#F60,255,128,128,128,128,128,128,128
POKE#F68,255,1,1,1,1,1,1,1
POKE#F70,128,128,128,128,128,128,128,255
POKE#F78,1,1,1,1,1,1,1,255
POKE#F80,255,129,129,129,129,129,129,129
POKE#F90,129,129,129,129,129,129,129,255
POKE#FA0,255,128,128,128,128,128,128,255
POKE#FA8,255,1,1,1,1,1,1,255
POKE#FC0,255,129,129,129,129,129,129,255
POKE#FE0,240,0,241,0,242,0,243,0
POKE#FE8,244,0,0,0,246,0,0,0
POKE#FF0,248,0,249,0,0,0,0,0
POKE#FF8,252,0,0,0,0,0,0,0
10 'ハコイリ ムスメ
20 VIDEO 6:CLS
30 COPY #780,#F60,160
40 ?CHR$(244,240,241,244)
50 ?CHR$(246,242,243,246)
60 ?CHR$(244,248,249,244)
70 ?CHR$(246,252,252,246)
80 ?CHR$(252,1,1,252)
90 ?CHR$(0,2,2,0);
100 X=2:Y=4:M=0
110 LC X,Y,1
120 K=INKEY():IF !K CONT
130 IF K<>32 GOTO 150
140 M=1-M:?CHR$(17);:GOTO 120
150 IF !M GOTO 370
160 P=SCR(X,Y):IF P=1 GOTO 370
170 P=P-240:Q=P%4:P=P-Q
180 A=X-Q%2:B=Y-Q/2
190 FOR S=0 TO 3
200 IF ![P+S] GOTO 220
210 LC A+S%2,B+S/2:?CHR$(1)
220 NEXT
230 C=A-(K=28)+(K=29)
240 D=B-(K=30)+(K=31):N=0
250 FOR S=0 TO 3
260 IF ![P+S] GOTO 280
270 IF SCR(C+S%2,D+S/2)<>1 N=1
280 NEXT
290 IF N=1 C=A:D=B
300 FOR S=0 TO 3
310 IF ![P+S] GOTO 340
320 LC C+S%2,D+S/2
330 ?CHR$([P+S])
340 NEXT
350 IF SCR(1,3)<>240 GOTO 370
360 LC 3,5:END
370 X=(X-(K=28)+(K=29)+4)%4
380 Y=(Y-(K=30)+(K=31)+5)%5
390 GOTO 110