private static bool isValidMove(Coin[,] state, Move m) { return isUsefulMove(state, m.Cell, m.DestinationCell()) || isUsefulMove(state, m.DestinationCell(), m.Cell) ; }
private static Coin[,] exchange(Coin[,] state, Move move) { Coin[,] result = Clone(state); result.put(move.DestinationCell(), state.get(move.Cell)); result.put(move.Cell, state.get(move.DestinationCell())); return result; }