Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.util.Random;
- public class Milestone1 {
- public static final int WORLD_ROWS = 8;
- public static final int WORLD_COLUMNS = 10;
- public static final char ALIVE = '@';
- public static final char DEAD = '.';
- public static final int SEED = 428;
- public static final double CHANCE_ALIVE = 0.25;
- public static void main(String[] args) {
- Scanner scnr = new Scanner(System.in);
- System.out.println("Welcome to Conway's Game Of Life");
- System.out.println("--------------------------------");
- System.out.println("1)Glider 2)Beacon 3)Beehive 4)R-pentomino");
- System.out.println("5)Random 6)Custom or 7)Exit");
- System.out.println("Choose a pattern: ");
- int userPattern = scnr.nextInt();
- if (userPattern == 7)
- {
- System.out.println("----------------------------");
- System.out.println("End of Conway's Game Of Life");
- }
- boolean [][] world = new boolean[WORLD_ROWS][WORLD_COLUMNS];
- /**for (int i = 0; i < WORLD_ROWS; i++) {
- for (int j = 0; j < WORLD_COLUMNS; j++) {
- System.out.println(world[i][j]);
- }
- }*/
- if (userPattern > 0 && userPattern <= 6) {
- System.out.println("");
- System.out.println("Fix me + cells are alive.");
- System.out.print("Press Enter for next generation, 'end' to stop: ");
- int userInput = scnr.nextInt();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement