SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   def tryToMove(board: Board, movementAndDestinations: List[(MovementClass, Field)], move: MovementClass): Unit = {
  2.     val lastField = movementAndDestinations.head._2
  3.     //    val newField = move.move(lastField.getColumn(), lastField.getRow())
  4.     //    if (!board.isInRange(newField)) {
  5.     //      return;
  6.     //    }
  7.     val newLastField = new Field(move.move(lastField.getColumn(), lastField.getRow()));
  8.  
  9.     tryAllPossibilities(board, (move, newLastField) :: movementAndDestinations);
  10.   }
  11.  
  12.   def tryAllPossibilities(board: Board, movementAndDestinations: List[(MovementClass, Field)]): Unit = {
  13.     println(movementAndDestinations.size)
  14.     println(movementAndDestinations)
  15.  
  16.     Movement.values.foreach(m => {
  17.       if (canMove(board, movementAndDestinations, m)) {
  18.         val lastField = movementAndDestinations.head._2
  19.         //        tryToMove(board, movementAndDestinations, m)
  20.         val newLastField = new Field(m.move(lastField.getColumn(), lastField.getRow()));
  21.         movementAndDestinations = (m, newLastField) :: movementAndDestinations);
  22.       }
  23.     });
  24.     tryAllPossibilities(board, movementAndDestination);
  25.   };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top