Flipping bits game: Difference between revisions

Line 2,869:
RANDOMIZE TIMER
DIM SHARED cellsPerSide, legalMoves$, startB$, currentB$, targetB$, moveCount
DIM SHARED VS(23) AS STRING * 80, prow, pcol
 
restart
DO
displayStatus
IF currentB$ = targetB$ THEN 'game done!
vplf PRINT " Congratulations, done in"; + STR$(moveCount) +; " moves."
vplf PRINT "": cp prow,PRINT " Press y for yes, if you want to start over > ";
yes$ = getKey$: cp prow,PRINT yes$: _DELAY .4: vcls
IF yes$ = "y" THEN restart ELSE nomore = -1
vcls
ELSE 'get next move
IF yes$ = "y" THEN restart ELSE nomore = -1
m$ = " ": PRINT
ELSE 'get next move
m$ =WHILE "INSTR(legalMoves$, ":m$) vplf= ""0
PRINT " Press a lettered column or a numbered row to flip (or 0,q,?,!) > ";
WHILE INSTR(legalMoves$, m$) = 0
m$ = getKey$: PRINT m$: _DELAY .4
vpstop " Press a lettered column or a numbered row to flip (or 0,q,?,!) > "
IF m$ = getKey$: vplf m$: _DELAY"!" .4THEN
IF showSolution = -1: m$ = "! ": EXIT THENWHILE
ELSEIF showSolutionm$ = -1"?" THEN: m$ = " ": EXITcp WHILECSRLIN, "Hint: " + hint$
ELSEIF m$ = "?0" OR m$ = "q" THEN: vcls: CLOSE: END
ELSEIF m$ = "" "THEN: cpm$ prow,= "Hint: " + hint$
ELSEIF m$END = "0" OR m$ = "q" THENIF
vcls: CLOSE: ENDWEND
IF showSolution THEN ELSEIF'run m$the =solution ""from THENhints function
showSolution = 0: mmv$ = " "hint$
cp CSRLIN + 1, "For the next move, the AI has chosen: " + mv$
END IF
cp CSRLIN + 1, "Running the solution with 4 sec screen delays..."
WEND
IF showSolution THEN _DELAY 4: vcls
showSolution =WHILE 0mv$ <> "Done?"
moveCount = moveCount + 1: makeMove mv$: displayStatus: mv$ = hint$
cp prowCSRLIN + 1, "For the next move, the AI has chosen: " + mv$
cp prowCSRLIN + 1, "Running the solution with 4 sec screen delays..."
_DELAY 4: vcls
vcls WEND
WHILE mv$ <> "Done?"displayStatus
cp CSRLIN + moveCount1, ="Done! moveCountCurrent + 1:board makeMovematches mv$Target"
cp CSRLIN + 1, "Press y for yes, if you want to start over: > "
displayStatus
yes$ = mvgetKey$: =PRINT hintyes$: _DELAY .4: vcls
IF yes$ = cp prow + 1, "Fory" theTHEN nextrestart move,ELSE thenomore AI= has chosen: " + mv$-1
ELSE
cp prow + 1, "Running the solution with 4 sec screen delays..."
vcls: moveCount = _DELAYmoveCount 4+ 1: makeMove m$
END vclsIF
END WENDIF
displayStatus
IF currentB$ = targetB$ THEN
cp prow + 1, "Done! Current board matches Target"
ELSE
cp prow + 1, "Hmm... Current board does NOT match Target???"
END IF
cp prow + 1, "Press y for yes, if you want to start over:"
yes$ = getKey$
cp prow, yes$: _DELAY .4
vcls
IF yes$ = "y" THEN restart ELSE nomore = -1
ELSE
vcls: moveCount = moveCount + 1: makeMove m$
END IF
END IF
LOOP UNTIL nomore
CLOSE
 
SUB displayStatus
COLOR 9: showBoard 2, 2, currentB$, "Current:"
COLOR 12: showBoard 2, 2 + 2 * cellsPerSide + 6, targetB$, "Target:"
COLOR 13: vplf ""PRINT: vplfPRINT " Number of moves taken so far is" + STR$(moveCount)
COLOR 14
END SUB
 
 
'this function will compare the currentB to targetB and suggest the next move with letter or digit
FUNCTION hint$ 'compare the currentB to targetB and suggest letter or digit or done
FUNCTION hint$
FOR i = 1 TO 2 * cellsPerSide 'check cols first then rows as listed in legalMoves$
r$ = MID$(legalMoves$, i, 1)
IF i <= cellsPerSide THEN
currentbit$ = MID$(currentB$, i, 1): targetBit$ = MID$(targetB$, i, 1)
targetBit IF currentbit$ =<> MID$(targetBtargetBit$, i,THEN flag = -1): EXIT FOR
ELSE
IF currentbit$ <> targetBit$ THEN flag = -1: EXIT FOR
ELSE j = i - cellsPerSide
j currentbit$ = iMID$(currentB$, (j - 1) * cellsPerSide + 1, 1)
currentbit targetBit$ = MID$(currentBtargetB$, (j - 1) * cellsPerSide + 1, 1)
targetBit$ =IF MIDcurrentbit$(targetB$, (j<> -targetBit$ 1)THEN *flag cellsPerSide += -1,: 1)EXIT FOR
END IF
IF currentbit$ <> targetBit$ THEN flag = -1: EXIT FOR
END IFNEXT
IF flag THEN hint$ = r$ ELSE hint$ = "Done?"
NEXT
IF flag THEN hint$ = r$ ELSE hint$ = "Done?"
END FUNCTION
 
SUB restart
CLOSE
OPEN "Copy Flipping Bits Game.txt" FOR OUTPUT AS #3
cellsPerSide = 0: legalMoves$ = "": moveCount = 0
COLOR 9: cp 3, "Flipping Bits Game, now with AI! b+ 2017-12-18"
COLOR 5
cp 5, "You will be presented with a square board marked Current and"
cp 6, "another marked Target. The object of the game is to match"
cp 7, "the Current board to Target in the least amount of moves."
cp 9, "To make a move, enter a letter for a column to flip or"
cp 10, "a digit for a row to flip. In a flip, all 1's are"
cp 11, "changed to 0's and all 0's changed to 1's."
cp 13, "You may enter 0 or q at any time to quit."
cp 14, "You may press ? when prompted for move to get a hint."
cp 15, "You may press ! to have the program solve the puzzle."
irow =COLOR 1614: COLORPRINT: 14PRINT
WHILE cellsPerSide < 2 OR cellsPerSide > 9
LOCATE CSRLIN, 13: PRINT "Please press how many cells you want per side 2 to 9 > ";
irow = irow + 1
in$ = getKey$: PRINT in$: _DELAY .4
vl irow, 12: vpstop "Please press how many cells you want per side 2 to 9 > "
IF in$ = "0" OR in$ = "q" THEN END ELSE cellsPerSide = VAL(in$)
in$ = getKey$
WEND
vplf in$: _DELAY .4
vcls
IF in$ = "0" OR in$ = "q" THEN END ELSE cellsPerSide = VAL(in$)
FOR i = 1 TO cellsPerSide: legalMoves$ = legalMoves$ + CHR$(96 + i): NEXT
WEND
FOR i = 1 TO cellsPerSide: legalMoves$ = legalMoves$ + LTRIM$(STR$(i)): NEXT
vcls
startB$ = startBoard$: currentB$ = startB$: targetB$ = makeTarget$: currentB$ = startB$
FOR i = 1 TO cellsPerSide: legalMoves$ = legalMoves$ + CHR$(96 + i): NEXT
FOR i = 1 TO cellsPerSide: legalMoves$ = legalMoves$ + LTRIM$(STR$(i)): NEXT
startB$ = startBoard$: currentB$ = startB$: targetB$ = makeTarget$: currentB$ = startB$
END SUB
 
FUNCTION startBoard$
FOR i = 1 TO cellsPerSide ^ 2: r$ = r$ + LTRIM$(STR$(INT(RND * 2))): NEXT
startBoard$ = r$
END FUNCTION
 
SUB showBoard (row, col, board$, title$)
vl LOCATE row - 1, col: vplfPRINT title$
FOR i = 1 TO cellsPerSide
vl LOCATE row, col + 2 * (i - 1) + 3: vpstopPRINT MID$(legalMoves$, i, 1);
NEXT
vplf ""PRINT
FOR i = 1 TO cellsPerSide
vl LOCATE row + i, col - 1: vpstopPRINT STR$(i);
FOR j = 1 TO cellsPerSide
vl LOCATE row + i, col + 2 * j: vpstopPRINT " " + MID$(board$, (i - 1) * cellsPerSide + j, 1);
NEXT
vplf ""PRINT
NEXT
END SUB
 
SUB makeMove (move$)
ac = ASC(move$)
IF ac > 96 THEN 'letter
col = ac - 96
FOR i = 1 TO cellsPerSide
bit$ = MID$(currentB$, (i - 1) * cellsPerSide + col, 1)
IF bit$ = "0" THEN
MID$(currentB$, (i - 1) * cellsPerSide + col, 1) = "1"
ELSE
MID$(currentB$, (i - 1) * cellsPerSide + col, 1) = "0"
END IF
NEXT
ELSE 'number
row = ac - 48
FOR i = 1 TO cellsPerSide
bit$ = MID$(currentB$, (row - 1) * cellsPerSide + i, 1)
IF bit$ = "0" THEN
MID$(currentB$, (row - 1) * cellsPerSide + i, 1) = "1"
ELSE
MID$(currentB$, (row - 1) * cellsPerSide + i, 1) = "0"
END IF
NEXT
END IF
END SUB
 
FUNCTION makeTarget$
WHILE currentB$ = startB$
FOR i = 1 TO cellsPerSide * cellsPerSide
m$ = MID$(legalMoves$, INT(RND * LEN(legalMoves$)) + 1, 1): makeMove m$
makeMove m$NEXT
NEXTWEND
makeTarget$ = currentB$
WEND
makeTarget$ = currentB$
END FUNCTION
 
'v subs for Virtual Screen, everything we print on screen we want to print to file
 
SUB cp (row, text$) 'center print at row
LOCATE row, (80 - LEN(text$)) / 2: PRINT text$;
MID$(VS(row), (80 - LEN(text$)) / 2, LEN(text$)) = text$
prow = row + 1: pcol = 1
END SUB
 
SUB vplf (text$)vcls 'print withthe screen to file then lineclear feedit
PRINT textDIM s$(23)
FOR lines = 1 TO 23
MID$(VS(prow), pcol, LEN(text$)) = text$
FOR t = 1 TO 80: scan$ = scan$ + CHR$(SCREEN(lines, t)): NEXT
prow = prow + 1: pcol = 1
s$(lines) = RTRIM$(scan$): scan$ = ""
END SUB
NEXT
 
FOR fini = 23 TO 1 STEP -1
SUB vpstop (text$) 'print with ;
IF s$(fini) <> "" THEN EXIT FOR
PRINT text$;
NEXT
MID$(VS(prow), pcol, LEN(text$)) = text$
PRINT #3, ""
pcol = pcol + LEN(text$)
FOR i = 1 TO fini: PRINT #3, s$(i): NEXT
END SUB
PRINT #3, "": PRINT #3, STRING$(80, "-"): CLS
 
SUB vl (r, c) 'virtual locate
LOCATE r, c
prow = r: pcol = c
END SUB
 
SUB vcls
DIM blank AS STRING * 80
FOR fini = 23 TO 1 STEP -1
IF VS(fini) <> blank THEN EXIT FOR
NEXT
PRINT #3, ""
FOR i = 1 TO fini
PRINT #3, VS(i)
NEXT
PRINT #3, ""
PRINT #3, STRING$(80, "-")
CLS
ERASE VS
prow = 1: pcol = 1
END SUB
 
FUNCTION getKey$ 'just want printable characters
k$ = ""
WHILE LEN(k$) = 0
k$ = INKEY$
IF LEN(k$) THEN 'press something so respond
IF LEN(k$) = 2 OR ASC(k$) > 126 OR ASC(k$) < 32 THEN k$ = "*": BEEP
END k$ = "*": BEEPIF
ELSEWEND
getKey$ = k$
IF ASC(k$) > 126 OR ASC(k$) < 32 THEN k$ = "*": BEEP
END IF
END IF
WEND
getKey$ = k$
END FUNCTION
</lang>
'''Output:'''
<lang>
Flipping Bits Game, now with AI! b+ 2017-12-18
Flipping Bits Game, now with AI! b+ 2017-12-18
You will be presented with a square board marked Current and
another marked Target. The object of the game is to match
the Current board to Target in the least amount of moves.
To make a move, enter a letter for a column to flip or
a digit for a row to flip. In a flip, all 1's are
changed to 0's and all 0's changed to 1's.
You may enter 0 or q at any time to quit.
You may press ? when prompted for move to get a hint.
You may press ! to have the program solve the puzzle.
Please press how many cells you want per side 2 to 9 > 9
 
You will be presented with a square board marked Current and
--------------------------------------------------------------------------------
another marked Target. The object of the game is to match
the Current board to Target in the least amount of moves.
 
To make a move, enter a letter for a column to flip or
Current: Target:
a b c d e f g h i a digit for a b c d e f g h i row to flip. In a flip, all 1's are
1 1 1 1 1 0 0 1 1 0 1 0 0 0changed 0to 0's 1and 1all 0's 0 changed to 1's.
2 0 1 1 1 0 1 0 1 1 2 0 1 1 1 1 1 1 1 0
3 1 0 0 0 0 1 1 0 0 3 0 1 1 1 0 0 1 1 0
4 0 0 1 0 1 1 1 1 0 4 1 1 0 1 1 0 1 0 0
5 0 1 1 0 0 0 1 0 1 5 1 0 0 1 0 1 1 1 1
6 1 1 1 0 1 0 0 1 0 6 1 1 1 0 0 0 1 1 1
7 0 1 1 0 0 1 0 1 1 7 0 1 1 0 1 1 1 1 0
8 1 1 1 0 0 1 0 1 1 8 0 0 0 1 0 0 0 0 1
9 0 0 0 1 1 1 1 1 1 9 1 1 1 0 1 0 1 0 1
Number of moves taken so far is 0
Press a lettered column or a numbered row to flip (or 0,q,?,!) > l
Press a lettered column or a numbered row to flip (or 0,q,?,!) > ?
Hint: a
Press a lettered column or a numbered row to flip (or 0,q,?,!) > a
 
You may enter 0 or q at any time to quit.
--------------------------------------------------------------------------------
You may press ? when prompted for move to get a hint.
You may press ! to have the program solve the puzzle.
 
Current: Target: Please press how many cells you want per side 2 to 9 > l
a b c d e f g h i a b c d e f g h i Please press how many cells you want per side 2 to 9 > *
1 0 1 1 1 0 0 1 1 0 1 0 0 0 0 0 1 1 0 0 Please press how many cells you want per side 2 to 9 > 3
2 1 1 1 1 0 1 0 1 1 2 0 1 1 1 1 1 1 1 0
3 0 0 0 0 0 1 1 0 0 3 0 1 1 1 0 0 1 1 0
4 1 0 1 0 1 1 1 1 0 4 1 1 0 1 1 0 1 0 0
5 1 1 1 0 0 0 1 0 1 5 1 0 0 1 0 1 1 1 1
6 0 1 1 0 1 0 0 1 0 6 1 1 1 0 0 0 1 1 1
7 1 1 1 0 0 1 0 1 1 7 0 1 1 0 1 1 1 1 0
8 0 1 1 0 0 1 0 1 1 8 0 0 0 1 0 0 0 0 1
9 1 0 0 1 1 1 1 1 1 9 1 1 1 0 1 0 1 0 1
Number of moves taken so far is 1
Press a lettered column or a numbered row to flip (or 0,q,?,!) > b
 
--------------------------------------------------------------------------------
 
Current: Target:
a b c d e f g h i a b c d e f g h i
1 0 0 1 1 0 0 1 1 0 1 0 0 0 0 0 1 1 0 0
2 1 0 1 1 0 1 0 1 1 2 0 1 1 1 1 1 1 1 0
3 0 1 0 0 0 1 1 0 0 3 0 1 1 1 0 0 1 1 0
4 1 1 1 0 1 1 1 1 0 4 1 1 0 1 1 0 1 0 0
5 1 0 1 0 0 0 1 0 1 5 1 0 0 1 0 1 1 1 1
6 0 0 1 0 1 0 0 1 0 6 1 1 1 0 0 0 1 1 1
7 1 0 1 0 0 1 0 1 1 7 0 1 1 0 1 1 1 1 0
8 0 0 1 0 0 1 0 1 1 8 0 0 0 1 0 0 0 0 1
9 1 1 0 1 1 1 1 1 1 9 1 1 1 0 1 0 1 0 1
Number of moves taken so far is 2
Press a lettered column or a numbered row to flip (or 0,q,?,!) > c
 
Number of moves taken so far is 0
--------------------------------------------------------------------------------
 
Press a lettered column or a numbered row to flip (or 0,q,?,!) > l
Current: Target:
Press a lettered column or a numbered row to flip (or 0,q,?,!) > 9
a b c d e f g h i a b c d e f g h i
Press a lettered column or a numbered row to flip (or 0,q,?,!) > *
1 0 0 0 1 0 0 1 1 0 1 0 0 0 0 0 1 1 0 0
Press a lettered column or a numbered row to flip (or 0,q,?,!) > a
2 1 0 0 1 0 1 0 1 1 2 0 1 1 1 1 1 1 1 0
3 0 1 1 0 0 1 1 0 0 3 0 1 1 1 0 0 1 1 0
4 1 1 0 0 1 1 1 1 0 4 1 1 0 1 1 0 1 0 0
5 1 0 0 0 0 0 1 0 1 5 1 0 0 1 0 1 1 1 1
6 0 0 0 0 1 0 0 1 0 6 1 1 1 0 0 0 1 1 1
7 1 0 0 0 0 1 0 1 1 7 0 1 1 0 1 1 1 1 0
8 0 0 0 0 0 1 0 1 1 8 0 0 0 1 0 0 0 0 1
9 1 1 1 1 1 1 1 1 1 9 1 1 1 0 1 0 1 0 1
Number of moves taken so far is 3
Press a lettered column or a numbered row to flip (or 0,q,?,!) > ?
Hint: d
Press a lettered column or a numbered row to flip (or 0,q,?,!) > d
 
--------------------------------------------------------------------------------
 
Current: Target:
a b c d e f g h i a b c d e f g h i
1 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 1 1 0 0
2 1 0 0 0 0 1 0 1 1 2 0 1 1 1 1 1 1 1 0
3 0 1 1 1 0 1 1 0 0 3 0 1 1 1 0 0 1 1 0
4 1 1 0 1 1 1 1 1 0 4 1 1 0 1 1 0 1 0 0
5 1 0 0 1 0 0 1 0 1 5 1 0 0 1 0 1 1 1 1
6 0 0 0 1 1 0 0 1 0 6 1 1 1 0 0 0 1 1 1
7 1 0 0 1 0 1 0 1 1 7 0 1 1 0 1 1 1 1 0
8 0 0 0 1 0 1 0 1 1 8 0 0 0 1 0 0 0 0 1
9 1 1 1 0 1 1 1 1 1 9 1 1 1 0 1 0 1 0 1
Number of moves taken so far is 4
Press a lettered column or a numbered row to flip (or 0,q,?,!) > 2
 
Number of moves taken so far is 1
--------------------------------------------------------------------------------
 
Press a lettered column or a numbered row to flip (or 0,q,?,!) > ?
Current: Target:
a b c d e f g h i a b c d e f g h i Hint: c
Press a lettered column or a numbered row to flip (or 0,q,?,!) > c
1 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 1 1 0 0
2 0 1 1 1 1 0 1 0 0 2 0 1 1 1 1 1 1 1 0
3 0 1 1 1 0 1 1 0 0 3 0 1 1 1 0 0 1 1 0
4 1 1 0 1 1 1 1 1 0 4 1 1 0 1 1 0 1 0 0
5 1 0 0 1 0 0 1 0 1 5 1 0 0 1 0 1 1 1 1
6 0 0 0 1 1 0 0 1 0 6 1 1 1 0 0 0 1 1 1
7 1 0 0 1 0 1 0 1 1 7 0 1 1 0 1 1 1 1 0
8 0 0 0 1 0 1 0 1 1 8 0 0 0 1 0 0 0 0 1
9 1 1 1 0 1 1 1 1 1 9 1 1 1 0 1 0 1 0 1
Number of moves taken so far is 5
Press a lettered column or a numbered row to flip (or 0,q,?,!) > !
For the next move, the AI has chosen: f
Running the solution with 4 sec screen delays...
 
--------------------------------------------------------------------------------
 
Current: Target:
a b c d e f g h i a b c d e f g h i
1 0 0 0 0 0 1 1 1 0 1 0 0 0 0 0 1 1 0 0
2 0 1 1 1 1 1 1 0 0 2 0 1 1 1 1 1 1 1 0
3 0 1 1 1 0 0 1 0 0 3 0 1 1 1 0 0 1 1 0
4 1 1 0 1 1 0 1 1 0 4 1 1 0 1 1 0 1 0 0
5 1 0 0 1 0 1 1 0 1 5 1 0 0 1 0 1 1 1 1
6 0 0 0 1 1 1 0 1 0 6 1 1 1 0 0 0 1 1 1
7 1 0 0 1 0 0 0 1 1 7 0 1 1 0 1 1 1 1 0
8 0 0 0 1 0 0 0 1 1 8 0 0 0 1 0 0 0 0 1
9 1 1 1 0 1 0 1 1 1 9 1 1 1 0 1 0 1 0 1
Number of moves taken so far is 6
For the next move, the AI has chosen: h
Running the solution with 4 sec screen delays...
 
Number of moves taken so far is 2
--------------------------------------------------------------------------------
 
Press a lettered column or a numbered row to flip (or 0,q,?,!) > l
Press a lettered column or a numbered row to flip (or 0,q,?,!) > 9
Press a lettered column or a numbered row to flip (or 0,q,?,!) > !
 
Current: Target: For the next move, the AI has chosen: 3
Running the solution with 4 sec screen delays...
a b c d e f g h i a b c d e f g h i
1 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 1 1 0 0
2 0 1 1 1 1 1 1 1 0 2 0 1 1 1 1 1 1 1 0
3 0 1 1 1 0 0 1 1 0 3 0 1 1 1 0 0 1 1 0
4 1 1 0 1 1 0 1 0 0 4 1 1 0 1 1 0 1 0 0
5 1 0 0 1 0 1 1 1 1 5 1 0 0 1 0 1 1 1 1
6 0 0 0 1 1 1 0 0 0 6 1 1 1 0 0 0 1 1 1
7 1 0 0 1 0 0 0 0 1 7 0 1 1 0 1 1 1 1 0
8 0 0 0 1 0 0 0 0 1 8 0 0 0 1 0 0 0 0 1
9 1 1 1 0 1 0 1 0 1 9 1 1 1 0 1 0 1 0 1
Number of moves taken so far is 7
For the next move, the AI has chosen: 6
Running the solution with 4 sec screen delays...
 
--------------------------------------------------------------------------------
 
Current: Target:
a b c d e f g h i a b c d e f g h i
1 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 1 1 0 0
2 0 1 1 1 1 1 1 1 0 2 0 1 1 1 1 1 1 1 0
3 0 1 1 1 0 0 1 1 0 3 0 1 1 1 0 0 1 1 0
4 1 1 0 1 1 0 1 0 0 4 1 1 0 1 1 0 1 0 0
5 1 0 0 1 0 1 1 1 1 5 1 0 0 1 0 1 1 1 1
6 1 1 1 0 0 0 1 1 1 6 1 1 1 0 0 0 1 1 1
7 1 0 0 1 0 0 0 0 1 7 0 1 1 0 1 1 1 1 0
8 0 0 0 1 0 0 0 0 1 8 0 0 0 1 0 0 0 0 1
9 1 1 1 0 1 0 1 0 1 9 1 1 1 0 1 0 1 0 1
Number of moves taken so far is 8
For the next move, the AI has chosen: 7
Running the solution with 4 sec screen delays...
 
Number of moves taken so far is 3
--------------------------------------------------------------------------------
 
Current: Target: For the next move, the AI has chosen: Done?
Running the solution with 4 sec screen delays...
a b c d e f g h i a b c d e f g h i
1 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 1 1 0 0
2 0 1 1 1 1 1 1 1 0 2 0 1 1 1 1 1 1 1 0
3 0 1 1 1 0 0 1 1 0 3 0 1 1 1 0 0 1 1 0
4 1 1 0 1 1 0 1 0 0 4 1 1 0 1 1 0 1 0 0
5 1 0 0 1 0 1 1 1 1 5 1 0 0 1 0 1 1 1 1
6 1 1 1 0 0 0 1 1 1 6 1 1 1 0 0 0 1 1 1
7 0 1 1 0 1 1 1 1 0 7 0 1 1 0 1 1 1 1 0
8 0 0 0 1 0 0 0 0 1 8 0 0 0 1 0 0 0 0 1
9 1 1 1 0 1 0 1 0 1 9 1 1 1 0 1 0 1 0 1
Number of moves taken so far is 9
For the next move, the AI has chosen: Done?
Running the solution with 4 sec screen delays...
 
--------------------------------------------------------------------------------
 
Current: Target:
a b c d e f g h i a b c d e f g h i
1 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 1 1 0 0
2 0 1 1 1 1 1 1 1 0 2 0 1 1 1 1 1 1 1 0
3 0 1 1 1 0 0 1 1 0 3 0 1 1 1 0 0 1 1 0
 
4 1 1 0 1 1 0 1 0 0 4 1 1 0 1 1 0 1 0 0
Number of moves taken so far is 3
5 1 0 0 1 0 1 1 1 1 5 1 0 0 1 0 1 1 1 1
 
6 1 1 1 0 0 0 1 1 1 6 1 1 1 0 0 0 1 1 1
7 0 1 1 0 1 1 1 1 0 7 0 1 1 0 1 1 1 1 0 Done! Current board matches Target
8 0 0 0 1 0 0 0 0 1 8 0 0 0 1 0 0 0 0 1 Press y for yes, if you want to start over: > m
9 1 1 1 0 1 0 1 0 1 9 1 1 1 0 1 0 1 0 1
Number of moves taken so far is 9
Done! Current board matches Target
Press y for yes, if you want to start over:
m
 
--------------------------------------------------------------------------------
Anonymous user