We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5a2a7ee commit 16836d5Copy full SHA for 16836d5
main-module/src/main/java/com/diffblue/javatest/TicTacToe.java
@@ -78,4 +78,23 @@ byte checkTicTacToePosition(byte[] a) {
78
// Neither player has won yet
79
return 0;
80
}
81
+
82
+ /**
83
+ * Convert char representaion of board state to byte representation.
84
+ */
85
+ static byte ticTacToeCharToByte(char c) {
86
+ switch (c) {
87
+ case 'X':
88
+ case 'x':
89
+ return 1;
90
+ case 'O':
91
+ case 'o':
92
+ case '0':
93
+ return 2;
94
+ case ' ':
95
+ return 0;
96
+ default:
97
+ throw new Error("Character " + c + " not recognized");
98
+ }
99
100
0 commit comments