Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class myGame {
- private static Scanner s = new Scanner(System.in);
- private static String input;
- public static void main(String[] args) {
- runGame();
- while (true) {
- System.out.print("Would you like to play again? (y/n) >> ");
- input = s.nextLine().toLowerCase();
- if (input.equals("y") runGame();
- else break;
- }
- }
- public void runGame {
- // your code here
- }
- }
Add Comment
Please, Sign In to add comment