ã¾ããµã ãã¯èªåã¯perlãªäººãªã®ã§ãæåã¯perlã§ãªã«ãä½ãããã¨æã£ã¦ãã®ã§ããã
ãã®ããã ãæãã1-Chip MSXãè³¼å
¥ãã¦ãã¾ãã¾ãã¦ã
å¥ã«æMSXãæã£ã¦ããããã§ããªããã¨ãããã¨ã¯ROMã«ã»ãããã»ã¨ãã©æã£ã¦ãããããããªããã§ãã®ã¾ã¾ã§ã¯ãæãããMSXãã¡ãã£ã¨èµ·åãã¦ã¿ã¾ããã以ä¸ã«ãªããªãã®ã§ãä»åã®好機ã使ã£ã¦ä½ãBASICããã°ã©ãã³ã°ã§ããããã¨æã£ã¦ã¿ãããã§ããã
ã¤ã¾ããç§ãMSXでプログラミングしてた人ã§ãã
ããã«ãã¦ãããããªã«MSX2ã£ã¦ã¹ããã¯ä½ãã£ãã£ãï¼
MSXã§ããã°ã©ãã³ã°ã¯ããªãã£ãããã§ã¯ããã¾ãããä¸å¦æ ¡ã®ã¯ã©ãæ´»åã§ä½¿ããMSX2ãã·ã³ã1å°ãã£ããã
ã§ããèªåã®å®¶ã«ãã£ãã®ã¯å¥ã®8ããããã·ã³ã ã£ãããé«æ ¡ã§ããã£ã¦ããã®ã¯ä¸»ã«å¯å£«éã®ãã·ã³ã ã£ãããMSX-BASICã£ã¦èãã¦ã¿ãã移æ¤ã®ãã¿å
ã«ãã使ã£ã¦ãªãã£ããã§ãã
ãããªããã§ãå®è³ªæåè²ã1è²ã®ã¿ãã¨ããã°ã©ãã£ãã¯æåã«ãã¿å¡ãã¤ã¶ããªâ ããªãã¨ãããããï¼ã¨æããã¨ãããã
ããç¨åº¦ã®ã³ãã³ããªãã¡ã¬ã³ã¹ã¯ãããä¸ã«è»¢ãã£ã¦ããã®ã§ããããã®è¾ºã®ãã¼ã¿ãã¡ãã£ã¨æ¢ããããªãã£ãã®ãæ®å¿µã§ãã
ä»åã®å®è³ªä½æ¥æéã¯4æéã
BASICãã®ãã®ã¯æããã£ã¦ããã®ã§ãè¡çªå·ããã°ã©ãã³ã°ã¨ããããªãã¨ã¯ãã£ã¦ããããã ã«æãåºãã¾ããããããæããããªãã£ããã¨ã«æ¸æãã°ãããMID$é¢æ°(æååããä¸é¨ã®æåãåãåºã)ã0ãªãªã¸ã³ã§ãªã1ãªãªã¸ã³ã ã£ãããwhileã«ã¼ãããªãã£ããã
ãã¨ãMSXã®ç»é¢ä¸ã§ããã°ã©ãã³ã°ãã¦ããã¨ããã£ã±ã大æåã§æ¸ãæ¹ãèªã¿ãããã§ããããã®é å
¨ã¦å¤§æåã ã£ãã®ã¯ãã®ãããã
ä½ãä½ããã¯ä¸å¿æ¹åã¨ãã¦ã¯æ±ºãã¦ããã¾ãããå®è³ª4æéã§ä½ãå½¢ã«ãªããã¨è¨ããã¨ãèããã¨ãåºæ¬ã¯ããã¹ã表示主ä½ããã¼ã¿å¦çãã§ãå¤éã®ãã¼ã¿ã¯ãã¹ãæéããããããªãã°ããºã«è§£æ³æ¯æ´ããã¨ã
ä»åãã¿ã«ããããºã«ã¯ãç¾è¡é¤¨ã
ãã³ã·ã«ããºã«ãã¾ãã¯ãã¹ã¯ã¼ãããºã«ã¨ãæ°ç¬ã¨ãããã®é¡ã®ç´ã¨éçã§è§£ãããºã«ã®ä¸ã«ãç¾è¡é¤¨ãã¨ããã®ãããã¾ãã発祥のニコリには解説ページがありますã®ã§ããã¡ããè¦ã¦ããã£ãæ¹ãããã®ã§ããã
- 10x10*1ã®ãã¹ç®ã«ã空ç½ã¨å£ãé ç½®ãã¦ããã
- å£ã®ä¸é¨ã«ã¯ãæ°åãæ¸ãã¦ãããããããã®å£ã®ä¸ä¸å·¦å³ã®ãã¹ã«é ç½®ãããæãã(â)ã®ç·æ°ã¨ãªãã
- æãã(â)ã¯ã1ã¤é ç½®ããããããã®ä¸ä¸å·¦å³ãå£ã«ã¶ã¤ããã¾ã§ã®å1ç´ç·ã®ãã¹(æããã«ç §ãããããã¹)ã«ã¯ä»ã®æããã¯é ç½®ãããªãã
- å ¨ã¦ã®ãã¹ã¯ãæãã(â)ã«ãã£ã¦ç §ããããªããã°ãªããªãã
ã¨ããã«ã¼ã«ã§ãã¦ã
ããã解ãã®ãæ¯æ´ããããã¨ããã®ãä»åã®ç®çã§ãã
ã³ã³ãã¥ã¼ã¿ã ã£ã¦ä½ãããºã«ããã³ã³ãã¥ã¼ã¿ã§è§£ããããã人ããããªããªã£ã¡ããããã
ããããã½ãªã®ã§ãããä»åä½ãããã°ã©ã ã¯ããã¾ã§ã解æ³æ¯æ´ãã§ãã£ã¦ããèªå解æãã§ã¯ããã¾ããã
ãããã ã£ã¦éæã£ã¦ããºã«è²·ããã§ãããèªåã§è§£ããªãããã£ãããªããããªãã§ããã
ä»åä½ãã®ã¯ãããã¾ã§ããç¹ã«èããªãã¦ãèªæã§è§£ããé¨åã¯è§£ãã¦ãã¾ããã¨ããã¨ããã¾ã§ã人éã¯ããããå
ã®è©¦è¡é¯èª¤ã ãã楽ããã°ãããã¨ããããã®ããã®ããã°ã©ã ã§ãã
BASICãã¹ãã²ãã£ããã°ã©ã ã®æ¸©åºã«ãªã£ã¦ããçç±ãæãåºããã
ããã«ãã¦ããä¹
ãã¶ãã®BASICã¯å¤§å¤ã§ããã
æ
£ããªããã¼ãã¼ãã§ã©ã¤ã³ã¨ãã£ã¿ãè¡çªå·ã®ä¸ã§Returnãã¼æ¼ãã®å¿ããããééãã¦ä¸æ¸ããããã
æ©è½è¿½å ãè¡çªå·åä½ã§ããããããã°ã©ã ãããªãè¦è¦ãããã¨ã«ãªã£ã¦ãã¾ãã
ãããããããã£ã¦ä½ã£ã¦ãããããã¹ãã²ãã£ã«ãªãããªã
10 DEFINT B-Z 20 DEF FNS(S,E)=-(E>S)+(E=<S) 30 DEF FNO(X,Y)=(X<0)+(X>9)+(Y<0)+(Y>9) 40 'Bijutsukan 50 SCREEN 0 60 DIM F(9,9),L(9,9),H(9,9),B(9,9),BU(3) 70 OPEN "data.dat" FOR INPUT AS #1 80 J=0 90 INPUT #1,A$:IF A$="[END]" THEN GOTO 170 100 FOR I=0 TO 9 110 D=VAL(MID$(A$,I+1,1)) 120 IF D>0 THEN F(I,J)=1 130 IF D>1 THEN H(I,J)=D-1 140 NEXT I 150 J=J+1 160 GOTO 90 170 CLOSE #1 180 LOCATE 0,0 190 PRINT "+----------+" 200 FOR I=0 TO 9:PRINT "| |":NEXT 210 PRINT "+----------+" 220 FOR Y=0 TO 9 230 FOR X=0 TO 9 240 LOCATE X+1,Y+1 250 IF F(X,Y)=1 THEN PRINT "#"; 260 IF H(X,Y)>0 THEN LOCATE X+1,Y+1:PRINT USING "#";H(X,Y)-1; 270 NEXT X:NEXT Y 280 LOCATE 0,13:AC$=INPUT$(1) 290 IF AC$=" " THEN GOSUB 330 300 IF AC$="f" THEN GOSUB 810 310 IF AC$="q" THEN END 320 GOTO 280 330 'scan sub 340 FOR J=0 TO 9 350 FOR I=0 TO 9 360 IF H(I,J)>0 THEN GOSUB 390 370 NEXT I:NEXT J 380 RETURN 390 'LRUD 400 C=0:CA=0:CF=0 410 FOR J2=J-1 TO J+1 420 IF FNO(I,J2)<0 THEN 510 430 FOR I2=I-1 TO I+1 440 IF FNO(I2,J)<0 THEN CF=CF+1:GOTO 500 450 IF I2<>I AND J2<>J THEN 500 460 IF I2=I AND J2=J THEN 500 470 IF F(I2,J2)=0 AND L(I2,J2)=0 THEN BU(C)=I2*10+J2:C=C+1 480 IF F(I2,J2)=0 AND B(I2,J2)=1 THEN CA=CA+1 490 IF F(I2,J2)=1 THEN CF=CF+1 500 NEXT I2 510 NEXT J2 520 LOCATE 0,14:PRINT I;J;H(I,J)-1;C;CA 530 IF H(I,J)=CA+1 AND C>0 THEN GOSUB 750:RETURN 540 IF H(I,J)=1 OR H(I,J)-1 <> C THEN RETURN 550 'Nuritsubushi 560 'LOCATE 0,13:PRINT I;J;C 570 FOR C2 = 0 TO C-1 580 I2=INT(BU(C2)/10):J2=BU(C2) MOD 10 590 B(I2,J2)=1:L(I2,J2)=1 600 LOCATE I2+1,J2+1:PRINT "o"; 610 JS=J2:JE=J2:IS=I2-1:IE=0:GOSUB 660 620 JS=J2:JE=J2:IS=I2+1:IE=9:GOSUB 660 630 JS=J2-1:JE=0:IS=I2:IE=I2:GOSUB 660 640 JS=J2+1:JE=9:IS=I2:IE=I2:GOSUB 660 650 NEXT C2 660 FOR J3=JS TO JE STEP FNS(JS,JE) 670 FOR I3=IS TO IE STEP FNS(IS,IE) 680 IF FNO(I3,J3)<0 THEN I3=IE:J3=JE:GOTO 700 690 IF F(I3,J3)=0 THEN GOSUB 720 ELSE I3=IE:J3=JE 700 NEXT I3:NEXT J3 710 RETURN 720 'print sub 730 L(I3,J3)=1:LOCATE I3+1,J3+1:IF B(I3,J3)=0 THEN PRINT "+"; 740 RETURN 750 'Already Put lights 760 FOR C2 = 0 TO C-1 770 I2=INT(BU(C2)/10):J2=BU(C2) MOD 10 780 L(I2,J2)=1:LOCATE I2+1,J2+1:PRINT "+"; 790 NEXT C2 800 RETURN 810 'Fill Blank Light 820 FOR J=0 TO 9 830 FOR I=0 TO 9 840 IF F(I,J)=0 AND L(I,J)=0 THEN GOSUB 870 850 NEXT I:NEXT J 860 RETURN 870 'check light 880 CH=0 890 JS=J:JE=J:IS=I-1:IE=0:GOSUB 980 900 JS=J:JE=J:IS=I+1:IE=9:GOSUB 980 910 JS=J-1:JE=0:IS=I:IE=I:GOSUB 980 920 JS=J+1:JE=9:IS=I:IE=I:GOSUB 980 930 LOCATE 0,14:PRINT I;J;L(I,J);CH 940 IF CH=1 THEN RETURN 950 B(I,J)=1:L(I,J)=1 960 LOCATE I+1,J+1:PRINT "o"; 970 RETURN 980 FOR J3=JS TO JE STEP FNS(JS,JE) 990 FOR I3=IS TO IE STEP FNS(IS,IE) 1000 IF FNO(I3,J3)<0 THEN I3=IE:J3=JE:GOTO 1030 1010 IF F(I3,J3)=1 THEN I3=IE:J3=JE:GOTO 1030 1020 IF L(I3,J3)=0 THEN CH=1:I3=IE:J3=JE 1030 NEXT I3:NEXT J3 1040 RETURN
ãã£ããä½ã£ããã¤ã§ãã®ã§ããã®æç¹ã§ã®完成品をこちらに置いてããã¾ãããã£ãè¡çªå·ãæç´ãããã¤ãã§ã«ãã£ã¹ã¯ã¤ã¡ã¼ã¸ãä½ãã¾ããã®ã§ãparaMSXãªã©ãªã©ã®MSXã¨ãã¥ã¬ã¼ã¿ã§ããã£ã¹ã¯ã¤ã¡ã¼ã¸ããã¦ã³ããã¦
LOAD "MUSEUM.BAS" RUN
ããã°ä½¿ããã¯ãã§ãã
ã¡ãªã¿ã«ããã¼å
¥åãä¿ãããã¨ããã§ãã¹ãã¼ã¹ãæ¼ãã°ãå·¦ä¸ããæãã(â)確å®é¨åãæ¤ç´¢ãfãæ¼ãã°æãã(â)è£å®ç¢ºå®é¨åãæ¤ç´¢ãqãæ¼ãã°çµäºãã¨ãªã£ã¦ã¾ãã
DATA.DATã¯ããºã«ã®ãã¡ã¤ã«ã0ã空ç½,1ãå£,2ããã³ã(0),3ããã³ã(1),4ããã³ã(2),5ããã³ã(3),6ããã³ã(4)ã1ãã¹ããã3bitã§è¡¨ããããã§ãã³ã¼ãå§ç¸®ããã°ãã£ã¨å°ãããã¡ã¤ã«ã«ãªãã¾ãããã¾ãããã¾ã§ã®å¿
è¦ã¯ãªããã¨ã
ã¡ãªã¿ã«ãããパズル通信ニコリ117å·ã®ãã©ã£ããç¾è¡é¤¨ãç¹éã®3åç®ã使ããã¦ããã ãã¦ãã¾ãã
ããã«æ·»ä»ãããé£åº¦ã®ããºã«ã ã¨ã解æ³æ¯æ´ã¨è¨ãã¤ã¤å
¨é¨è§£ãã¡ããã¾ããã
*1:å®éã«ã¯ä»»æã ãã©