Game of life, JAVA Programming

Assignment Help:

Conway's Game of Life is a "cellular automaton" that is played on a 2D grid (array) of cells. At the start of the game, an initial configuration is set up in which a number of cells are considered to be alive, while the remainder of the cells are considered to be dead.

The game of life proceeds in discrete steps called generations. In each generation, some of the cells will change from dead to alive, and vice-versa, according to specific rules. The rules are based on the neighborhood of 8 cells surrounding each cell, and are given as follows:

1.     Any live cell with fewer than two live neighbours dies, as if caused by under-population.

2.     Any live cell with two or three live neighbours lives on to the next generation.

3.     Any live cell with more than three live neighbours dies, as if by overcrowding.

4.     Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.

Assignment

In this assignment, you will implement Conway's game of life. Like Mine Sweeper, this is a good project for working with 2D arrays, and also will give you some experience reading text files, as well as some simple GUI programming.

Instructions

1.  Write a program that will play Conway's game of life.

2.  The program must take the name of an input text file as user input somehow.

3. Input files will contain a first line stating the resolution of the life array, and then a number of lines giving the initial configuration of the array. (An "X" character is considered to be alive, and other characters are considered to be dead.) Your program must be able to handle life arrays of different sizes specified in an input file.

4.  Your program must handle "toroidal addressing" for the edges of the array. In other words, the left and right sides of the life array must be connected, as well as the top and bottom.

5.  You should display your life game in a GUI window. There are several ways to do this. One would be to have your application extend JFrame, and then use JLabels for each of the cells in a GridLayout.

6.   Provide a way for the user to specify the rate at which generations occur (for example, by using a Timer).

7.   Optional: Create a few interesting input files for your program.


Related Discussions:- Game of life

Client for nokia symbian platform, Project Description: I need Team spea...

Project Description: I need Team speak 3 client for Nokia Symbian platform. Project for Nokia E72, but should work on all Java/Symbian mobiles. Feature list should include

Develop a custom android app, Develop a Custom Android App Project Descr...

Develop a Custom Android App Project Description: We want you to construct a custom Android app. Once user downloads the app and upon installation the user gets push notif

User defined key class in the hashtables aur hashmap, You should override ...

You should override the hashCode() and equals() functions from the Object class. The default implementation of the hashcode() and equals(), which are inherited from the java.

Write a java code to draw ovals and circles, Write a java code to draw Oval...

Write a java code to draw Ovals and Circles? Java has techniques to draw outlined and filled ovals. As you'd probably guess these methods are called drawOval() and fillOval() c

Heap and Stack memory allocation in java, Each time an object is started in...

Each time an object is started in Java it goes into the area of memory named as heap. The primitive variables like double and int are allocated in the stack, if they are local inst

data integrity - security component, Data integrity helps to make sure if ...

Data integrity helps to make sure if something is communicate and not tampered with in the mean while when transmission take place. Checksums: Simply inserts the bytes withi

Create a program using constructors, Create a program Using Constructors? ...

Create a program Using Constructors? The further program uses the constructor to initialize a car rather than setting the areas directly. class CarTest7 { public static voi

Loop statements, A loop is a set of commands which executes repeatedly till...

A loop is a set of commands which executes repeatedly till a denoted condition is met. JavaScript supports two loop statements: for & while. Additionally, you can employ the break

Palindrome, A palindrome is a string that reads the same from both the ends...

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Introduction, the multiple of two number in java

the multiple of two number in java

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd