예제 #1
0
 private static bool isValidMove(Coin[,] state, Move m)
 {
     return
         isUsefulMove(state, m.Cell, m.DestinationCell()) ||
         isUsefulMove(state, m.DestinationCell(), m.Cell)
         ;
 }
예제 #2
0
 private static Tuple<Coin[, ], int> MakeMove(Coin[,] state, Move move)
 {
     return destroy(exchange(state, move));
 }
예제 #3
0
 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;
 }