Advertisement
Guest User

Untitled

a guest
Mar 4th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class bugTester
  3. {
  4. public static void main()
  5. {
  6. bug b1 = new bug();
  7. System.out.println("The inital position of the bug is >>> ");
  8. System.out.println("Direction " + b1.getDirection());
  9. System.out.println("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\");
  10. System.out.println("Row " + b1.getRow());
  11. System.out.println("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\");
  12. System.out.println("Column " + b1.getColumn());
  13. System.out.println("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\");
  14. b1.display();
  15.  
  16. boolean retry = true;
  17. while(retry == true)
  18. {
  19. System.out.println("Please enter a Direction you would like to go(1-N 2-S 3-E 4 - W)");
  20. Scanner in = new Scanner(System.in);
  21. b1.turn(in.nextInt());
  22.  
  23. System.out.println("Please enter an ammount of units you would like to move");
  24. b1.move(in.nextInt());
  25.  
  26. b1.display();
  27. System.out.println("Would you like to move the bug again y-yes n-no >>>>>");
  28. String s = in.nextLine();
  29. if(s.equals("n"))
  30. {
  31. System.out.println("Thank you for using the bug Program tester");
  32. retry = false;
  33. }
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement