Exemplo n.º 1
0
 private int Score(Move mv)
 {
     int delx = mv.End.Item2 - mv.Start.Item2;
     int dely = mv.End.Item1 - mv.Start.Item1;
     switch (mv.Player)
     {
         case Space.Player1:
             return (dely) *16 - mv.Start.Item1;
         case Space.Player2:
             return (dely- delx)*16 - mv.Start.Item1 + mv.Start.Item2;
         case Space.Player3:
             return (-delx) * 16 + mv.Start.Item2;
         case Space.Player4:
             return (-dely) * 16 + mv.Start.Item1;
         case Space.Player5:
             return (delx- dely) * 16 - mv.Start.Item2 + mv.Start.Item1;
         case Space.Player6:
             return (delx) * 16 - mv.Start.Item2;
         default:
             return -300;
     }
 }
Exemplo n.º 2
0
 public List<Move> getPlayerMoves(Space player)
 {
     List<Move> moves= new List<Move>();
     for (int i = 0; i < 17; ++i)
     {
         for (int j = 0; j < 17; ++j)
         {
             if(currBoard[i,j] == player)
             {
                 Tuple<int, int> start = new Tuple<int, int>(i, j);
                 List<Tuple<int, int>>  movelist =getMoves(i, j);
                 foreach(Tuple<int, int> end in movelist)
                 {
                     Move mv = new Move();
                     mv.End = end;
                     mv.Start = start;
                     mv.Player = player;
                     moves.Add(mv);
                 }
             }
         }
     }
     return moves;
 }