Advertisement
Guest User

Untitled

a guest
May 27th, 2015
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class main
  4. {
  5. public static void main(String[] args)
  6. {
  7. Scanner input=new Scanner(System.in);
  8. String select;
  9. int x, y;
  10. int turn;
  11.  
  12.  
  13. System.out.print("Do you want to play a game? (Yes/No) : ");
  14. select = input.next();
  15. while(true)
  16. {
  17. if (select.equals("Yes"))
  18. {
  19. System.out.print("Please input game board's array size (n) : ");
  20. x=input.nextInt();
  21. y=x;
  22.  
  23. System.out.print("Who is the first player? (1/2) : ");
  24. turn=input.nextInt();
  25.  
  26. Game game=new Game(x, y, turn);
  27. game.game_core();
  28.  
  29. if(game.quit_game()==2)
  30. {
  31. break;
  32. }
  33. }
  34.  
  35. else
  36. {
  37. break;
  38. }
  39. }
  40.  
  41. System.out.println("Exit ..");
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement