Advertisement
cgorrillaha

Untitled

Mar 17th, 2022
847
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. public static void move10(Bot b, Map m){
  2.         int movesMade=0;
  3.         int turnCount=0;
  4.  
  5.         while (movesMade<10&&turnCount<4){
  6.            
  7.             if(b.move(m)){
  8.                 movesMade++;
  9.                 turnCount=0;
  10.                 System.out.println(b+": moved");
  11.             }
  12.             else{
  13.                 b.turn();
  14.                 turnCount++;
  15.                 System.out.println(b+": turned");
  16.             }
  17.         }
  18.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement