Advertisement
Guest User

Untitled

a guest
Jun 25th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.19 KB | None | 0 0
  1. AlphaBeta_Core thisState = new AlphaBeta_Core(fieldsForMiniMax, false);  
  2.                 AlphaBeta_Core next = thisState.FindNextMove(depth);
  3.                
  4.                 if (next != null)
  5.                 {
  6.                     Debug.WriteLine("WYBRANY SCORE: " + next.m_Score);
  7.                     idFieldToPlaceBall = Convert.ToInt32(next.Moves[0]);
  8.  
  9.                 }
  10.  
  11.                 if (idFieldToPlaceBall != null)
  12.                 {
  13.                     AssignBallTo(Convert.ToInt32(idFieldToPlaceBall), TakenBy.Computer);
  14.                     SwitchMoveOrder();
  15.  
  16.                     //var computerFieldsIds = fields.Where(cf => cf.TakenBy == TakenBy.Computer).Select(i => i.Id).ToList();
  17.                     foreach (var line in possibleThrees)
  18.                     {
  19.                     if (line.Where(l => getAssigment(l) == TakenBy.Computer).Count() == 3 && (line[0] == idFieldToPlaceBall || line[1] == idFieldToPlaceBall || line[2] == idFieldToPlaceBall))
  20.                         {
  21.                             TakePlayerBall();
  22.                         }
  23.                     }  
  24.                     Debug.WriteLine("Pushing ball MINIMAX.");
  25.                     return;
  26.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement