1 REM >>>> START <<<<
10 SCREEN4,2,2:CONSOLE0,16,,0
20 COLOR,,2:OUT&H93,2:CLS
30 CLEAR50:DIMA(143),B(14,7,4)
40 FORI=0TO143:A(I)=INT(I/4)+1:NEXT:A=RND(-TIME)
50 FORI=0TO143:A=RND(1)*144:B=A(I):A(I)=A(A):A(A)=B:NEXT
60 FORYY=0TO7:READA$:FORXX=1TO12:A=VAL(MID$(A$,XX,1))
70 IFA<5THENFORZ=0TOA:I=I-1:B(XX,YY,Z)=A(I):NEXT:Z=Z-1:GOSUB510
80 NEXTXX,YY
90 B(0,4,0)=1:B(13,4,0)=1
100 LINE(109,81)-(121,101),0,BF
110 YY=3.5:FORI=0TO3:READXX,Z:B(XX,YY,Z)=A(I):GOSUB510:NEXT
120 D=0:X=6:Y=3:X1=-1:OUT&H93,3
121 REM >>>> KEY <<<<
130 X2=X:Y2=Y
140 IF(X=6ORX=7)*(Y=3ORY=4)*(B(6,3,4)>0)THENX2=6.5:Y2=3.5
150 IF(X=0ORX>12)*(Y=3ORY=4)*(B(X,3,0)>0)THENY2=3.5
160 A=X2*16+11:B=Y2*24+10
170 LINE(A,B)-(A+4,B+4),1
180 LINE(A+4,B)-(A,B),1
190 LINE-(A,B+4),1
200 IFSTRIG(0)=1THEN310
210 C=STICK(0):IFCTHEN250
220 A$=INKEY$:EXEC&H1058
230 IF(A$=CHR$(13)ORA$=CHR$(18))*DTHEN600
240 GOTO200
241 REM >>>> CURSOR <<<<
250 LINE(A,B)-(A+4,B+4),0,BF
260 X=X+(C=3)*(X<14)-(C=7)*(X>0)
270 Y=Y-(C=1)*(Y>0)+(C=5)*(Y<7)
280 IF(C=3ORC=7)*(X2=6.5)THENX=5-(C=3)*3
290 IF(C=1ORC=5)*(Y2=3.5)THENY=2-(C=5)*3
300 GOTO130
301 REM >>>> SPACE <<<<
310 IFX1=X2ANDY1=Y2THENLINE(A-7,(14-B)*(Y>0))-(A+7,B+8),1,B:GOTO490
320 FORZ2=4TO0STEP-1:IFB(X2,Y2,Z2)<1THENNEXT
330 IFZ2<0THEN200
340 IFX=0ORX=14THEN360
350 IFB(X-1,Y,Z2)>0ANDB(X+1,Y2,Z2)>0THEN130
360 IFX1<0THEN380
370 IFB(X1,Y1,Z1)-B(X2,Y2,Z2)THEN130
380 LINE(A-7,(14-B)*(Y>0))-(A+7,B+8),0,B
390 IFX1<0THENX1=X2:Y1=Y2:Z1=Z2:GOTO130
400 LINE(X1*16+4,(4-Y1*24)*(Y1>0))-(X1*16+18,Y1*24+18),0,BF
410 LINE(A-7,(14-B)*(Y>0))-(A+7,B+8),0,BF
420 B(X1,Y1,Z1)=-B(X1,Y1,Z1)
430 B(X2,Y2,Z2)=-B(X2,Y2,Z2)
440 IFX1=0ORX1=13THENB(X1,4,0)=-1
450 IFX2=0ORX2=13THENB(X2,4,0)=-1
460 XX=X1:YY=Y1:Z=Z1-1:ON(Z1>0)*(Z<3)-(Z=3)*2GOSUB510,500
470 XX=X2:YY=Y2:Z=Z2-1:ON(Z2>0)*(Z<3)-(Z=3)*2GOSUB510,500
480 A(D)=X1*100+Y1:A(D+1)=X2*100+Y2:D=D+2
490 X1=-1:GOTO130
500 FORYY=3TO4:FORXX=6TO7:GOSUB510:NEXTXX,YY:RETURN
501 REM >>>> LINE <<<<
510 A=XX*16+4:B=YY*24-4:ONZ+1GOTO560,540,530,520,560
520 LINE(A+2,B+3)-(A+12,B+19),1,B
530 LINE(A+1,B+2)-(A+13,B+20),1,B
540 LINE(A+1,B+1)-(A+13,B+2),1,B
550 LINE(A+1,B+20)-(A+13,B+21),1,B
560 LINE(A,-B*(YY>0))-(A+14,B+22),1,B
570 LOCATEXX*2+1,YY*2:A=B(XX,YY,Z)
580 PRINTCHR$(A+47-(A>10)*7)
590 RETURN
591 REM >>>> SPECIAL <<<<
600 LINE(A,B)-(A+4,B+4),0,BF
610 IFX1>-1THENLINE(X1*16+4,(4-Y1*24)*(Y1>0))-(X1*16+18,Y1*24+18),1,B
620 IFASC(A$)=13THEND=D-2:FORI=DTOD+1:GOTO640
630 OUT&H93,2:FORI=D-1TO0STEP-1
640 XX=INT(A(I)/10)/10:YY=A(I)-XX*100
650 A=XX*16+5:B=YY*24-3
660 LINE(A,B-(B<0)*3)-(A+12,B+20),0,BF
670 FORZ=0TO3:IFB(XX,YY,Z)>0THENNEXT
680 B(XX,YY,Z)=-B(XX,YY,Z)
690 GOSUB510
700 IFXX=0ORXX=13THENB(XX,4,0)=1
710 NEXTI
720 IFASC(A$)=18THEN120
730 X1=-1:EXEC&H1058:GOTO130
731 REM >>>> DATA <<<<
740 DATA000000000000
750 DATA550111111055
760 DATA500122221005
770 DATA000123321000
780 DATA000123321000
790 DATA500122221005
800 DATA550111111055
810 DATA000000000000
820 DATA,,13,,14,,6.5,4
トップ > 雑多なもの > PC-6001自作ゲーム思い出語り > 上海 リスト