Skip to content

Commit b1553af

Browse files
committed
TicTacToe rule notes
1 parent e30def0 commit b1553af

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/scorekeep/TicTacToe.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ public static int toInt(char[] state, char turn) {
8484
* O
8585
* X X X
8686
* Xs state in binary is 010000111, 135 in decimal. 135 is a bitwise match
87-
* for 000000111, 7 in decimal, one of the 8 winning states.
87+
* for 000000111, 7 in decimal, one of the 8 winning states:
88+
* 111000000 448 010010010 146
89+
* 000111000 56 001001001 73
90+
* 000000111 7 100010001 273
91+
* 100100100 292 001010100 84
8892
*/
8993
public static boolean checkWin(int state) {
9094
int[] winningStates = {7,56,73,84,146,273,292,448};

0 commit comments

Comments
 (0)