(Piece[][] board, int fixed_index, Check check)
| 28 | } |
| 29 | |
| 30 | public static Piece getWinner(Piece[][] board, int fixed_index, Check check) { |
| 31 | Piece color = getIthColor(board, fixed_index, 0, check); |
| 32 | if (color == Piece.Empty) { |
| 33 | return Piece.Empty; |
| 34 | } |
| 35 | for (int var = 1; var < board.length; var++) { |
| 36 | if (color != getIthColor(board, fixed_index, var, check)) { |
| 37 | return Piece.Empty; |
| 38 | } |
| 39 | } |
| 40 | return color; |
| 41 | } |
| 42 | |
| 43 | /* Only works for 3x3 board */ |
| 44 | public static Piece hasWon1(Piece[][] board) { |