@Test public void testwinningCond() { int N = 2; MutableBoard board = new MutableBoard(N); assertFalse(board.winningCond()); board.set(0, 2, RED); board.set(1, 2, BLUE); board.set(2, 2, RED); board.set(3, 2, BLUE); assertFalse(board.winningCond()); board.set(0, 2, BLUE); board.set(1, 2, BLUE); board.set(2, 2, BLUE); board.set(3, 2, BLUE); assertTrue(board.winningCond()); board.set(1, 2, RED); assertFalse(board.winningCond()); }
public boolean winningCond() { if (_squareline[0] == null) { System.out.println("This fucks up everything."); } Side initial = _squareline[0].getSide(); if (initial == WHITE) { return false; } for (Square sqr : _squareline) { if (sqr.getSide() != initial) { return false; } } return true; }
Board extends Observable { public boolean winningCond() { if (_squareline[0] == null) { System.out.println("This fucks up everything."); } Side initial = _squareline[0].getSide(); if (initial == WHITE) { return false; } for (Square sqr : _squareline) { if (sqr.getSide() != initial) { return false; } } return true; } }
Board extends Observable { public boolean winningCond() { if (_squareline[0] == null) { System.out.println("This fucks up everything."); } Side initial = _squareline[0].getSide(); if (initial == WHITE) { return false; } for (Square sqr : _squareline) { if (sqr.getSide() != initial) { return false; } } return true; }  }
Board extends Observable { public boolean winningCond() { if (_squareline[0] == null) { System.out.println("This fucks up everything."); } Side initial = _squareline[0].getSide(); if (initial == WHITE) { return false; } for (Square sqr : _squareline) { if (sqr.getSide() != initial) { return false; } } return true; }  Square[] getData(); @Override String toString(); boolean winningCond(); String toDisplayString(); int neighborePos(int n, Direction pos); }
Board extends Observable { public boolean winningCond() { if (_squareline[0] == null) { System.out.println("This fucks up everything."); } Side initial = _squareline[0].getSide(); if (initial == WHITE) { return false; } for (Square sqr : _squareline) { if (sqr.getSide() != initial) { return false; } } return true; }  Square[] getData(); @Override String toString(); boolean winningCond(); String toDisplayString(); int neighborePos(int n, Direction pos);  }