1
0
mirror of https://github.com/rfivet/BCG101.git synced 2024-12-19 00:26:41 -05:00

Clarify check of adjacent unmarked cells.

This commit is contained in:
Renaud 2024-04-24 10:06:17 +08:00
parent 7f08afb138
commit 694ad73a9b

View File

@ -26,8 +26,7 @@
187 ' PICK EXIT CELL ON BOTTOM ROW AS CURRENT 187 ' PICK EXIT CELL ON BOTTOM ROW AS CURRENT
190 R=FNR(H+1)-1\ S=V ' R,S CURRENT CELL COORD 190 R=FNR(H+1)-1\ S=V ' R,S CURRENT CELL COORD
192 V(R,S)=2 192 V(R,S)=2
193 C=C-1 193 GOTO 999
202 GOTO 260
209 ' SCAN FOR NEXT POSITION TO CHECK 209 ' SCAN FOR NEXT POSITION TO CHECK
210 R=R+1 210 R=R+1
215 IF R<=H THEN 250 215 IF R<=H THEN 250
@ -36,62 +35,33 @@
230 S=0 230 S=0
250 IF V(R,S)=0 THEN 210 250 IF V(R,S)=0 THEN 210
255 ' CHECK FOR ADJACENT UNMARKED CELLS AND PICK ONE AT RANDOM 255 ' CHECK FOR ADJACENT UNMARKED CELLS AND PICK ONE AT RANDOM
260 IF R=0 THEN 530\ IF V(R-1,S)<>0 THEN 530 ' L? 260 T=1
270 IF S=0 THEN 390\ IF V(R,S-1)<>0 THEN 390 ' LU? 261 IF R=0 THEN 262\ IF V(R-1,S)<>0 THEN 262\ T=T+1 ' L
290 IF R=H THEN 330\ IF V(R+1,S)<>0 THEN 330 ' LUR? 262 IF S=0 THEN 263\ IF V(R,S-1)<>0 THEN 263\ T=T+2 ' U
310 ON FNR(3) GOTO 790,820,860 ' LUR 263 IF R=H THEN 264\ IF V(R+1,S)<>0 THEN 264\ T=T+4 ' R
320 ' LU 264 IF S=V THEN 265\ IF V(R,S+1)<>0 THEN 265\ T=T+8 ' D
330 IF S=V THEN 370\ IF V(R,S+1)<>0 THEN 370 ' LUD? 265 ' 0, L, U, LU, R, LR, UR,LUR, D, LD, UD,LUD, RD,LRD,URD,LURD
350 ON FNR(3) GOTO 790,820,910 ' LUD 300 ON T GOTO 210,790,820,370,860,450,590,310,910,500,640,350,710,430,570
370 ON FNR(2) GOTO 790,820 ' LU 310 ON FNR(3) GOTO 790,820,860 ' LUR
380 ' L 350 ON FNR(3) GOTO 790,820,910 ' LUD
390 IF R=H THEN 470\ IF V(R+1,S)<>0 THEN 470 ' LR? 370 ON FNR(2) GOTO 790,820 ' LU
401 IF S=V THEN 450\ IF V(R,S+1)<>0 THEN 450 ' LRD? 430 ON FNR(3) GOTO 790,860,910 ' LRD
430 ON FNR(3) GOTO 790,860,910 ' LRD 450 ON FNR(2) GOTO 790,860 ' LR
450 ON FNR(2) GOTO 790,860 ' LR 500 ON FNR(2) GOTO 790,910 ' LD
460 ' L 570 ON FNR(3) GOTO 820,860,910 ' URD
470 IF S=V THEN 790\ IF V(R,S+1)<>0 THEN 790 ' LD? OR L 590 ON FNR(2) GOTO 820,860 ' UR
500 ON FNR(2) GOTO 790,910 ' LD 640 ON FNR(2) GOTO 820,910 ' UD
520 ' 710 ON FNR(2) GOTO 860,910 ' RD
530 IF S=0 THEN 670\ IF V(R,S-1)<>0 THEN 670 ' U? 720 '
541 IF R=H THEN 610\ IF V(R+1,S)<>0 THEN 610 ' UR?
550 IF S=V THEN 590\ IF V(R,S+1)<>0 THEN 590 ' URD?
570 ON FNR(3) GOTO 820,860,910 ' URD
590 ON FNR(2) GOTO 820,860 ' UR
600 '
610 IF S=V THEN 820\ IF V(R,S+1)<>0 THEN 820 ' UD? OR U
640 ON FNR(2) GOTO 820,910 ' UD
660 '
670 IF R=H THEN 740\ IF V(R+1,S)<>0 THEN 740 ' R?
681 IF S=V THEN 860\ IF V(R,S+1)<>0 THEN 860 ' RD? OR R
710 ON FNR(2) GOTO 860,910 ' RD
730 '
740 IF S=V THEN 210\ IF V(R,S+1)<>0 THEN 210 ' D? OR SCAN
770 GOTO 910 ' D
780 '
790 ' REMOVE LEFT WALL 790 ' REMOVE LEFT WALL
800 R=R-1 800 R=R-1\ V(R,S)=3\ GOTO 999
801 V(R,S)=3
812 GOTO 999
820 ' REMOVE UP WALL 820 ' REMOVE UP WALL
830 S=S-1 830 S=S-1\ V(R,S)=2\ GOTO 999
840 V(R,S)=2
850 GOTO 999
860 ' REMOVE RIGHT WALL 860 ' REMOVE RIGHT WALL
870 IF V(R,S)<2 THEN 880 870 V(R,S)=V(R,S)+2\ R=R+1\ GOTO 998
872 V(R,S)=4
873 GOTO 890
880 V(R,S)=3
890 R=R+1
900 IF V(R,S)<>0 THEN 902\ V(R,S)=1
902 GOTO 999
910 ' REMOVE DOWN WALL 910 ' REMOVE DOWN WALL
922 IF V(R,S)<2 THEN 940 922 V(R,S)=V(R,S)+1\ S=S+1
930 V(R,S)=4 998 V(R,S)=1
931 GOTO 950
940 V(R,S)=2
950 S=S+1
960 IF V(R,S)<>0 THEN 999\ V(R,S)=1
999 C=C-1\ IF C>0 THEN 260 ' LOOP WHILE C 999 C=C-1\ IF C>0 THEN 260 ' LOOP WHILE C
1000 ' DRAW MAZE 1000 ' DRAW MAZE
1010 FOR J=0 TO V 1010 FOR J=0 TO V