You are viewing a single comment's thread. Return to all comments →
Created board using Grundy -- Time taking solution. But Works!
static int[][] chess= { {0,0,1,1,0,0,1,1,0,0,1,1,0,0,1}, {0,0,2,1,0,0,1,1,0,0,1,1,0,0,1}, {1,2,2,2,3,2,2,2,3,2,2,2,3,2,1}, {1,1,2,1,4,3,2,3,3,3,2,3,3,3,1}, {0,0,3,4,0,0,1,1,0,0,1,1,0,0,1}, {0,0,2,3,0,0,2,1,0,0,1,1,0,0,1}, {1,1,2,2,1,2,2,2,3,2,2,2,3,2,1}, {1,1,2,3,1,1,2,1,4,3,2,3,3,3,1}, {0,0,3,3,0,0,3,4,0,0,1,1,0,0,1}, {0,0,2,3,0,0,2,3,0,0,2,1,0,0,1}, {1,1,2,2,1,1,2,2,1,2,2,2,3,2,1}, {1,1,2,3,1,1,2,3,1,1,2,1,4,3,1}, {0,0,3,3,0,0,3,3,0,0,3,4,0,0,1}, {0,0,2,3,0,0,2,3,0,0,2,3,0,0,2}, {1,1,1,1,1,1,1,1,1,1,1,1,1,2,1} }; static String chessboardGame(int[][] coins) { int xor = 0; for (int[] Y : coins) { int x = Y[0]-1; int y = Y[1]-1; xor^=chess[x][y]; } if (xor == 0) return "Second"; return "First"; }
Seems like cookies are disabled on this browser, please enable them to open this website
Chessboard Game, Again!
You are viewing a single comment's thread. Return to all comments →
Created board using Grundy -- Time taking solution. But Works!