Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Assignment - Description of Game - Introduction Object Oriented Programming | CS 1331, Assignments of Computer Science

Material Type: Assignment; Professor: Stasko; Class: Intro-Object Orient Prog; Subject: Computer Science; University: Georgia Institute of Technology-Main Campus; Term: Spring 2007;

Typology: Assignments

Pre 2010

Uploaded on 08/04/2009

koofers-user-xkb-1
koofers-user-xkb-1 🇺🇸

10 documents

1 / 4

Toggle sidebar

Related documents


Partial preview of the text

Download Assignment - Description of Game - Introduction Object Oriented Programming | CS 1331 and more Assignments Computer Science in PDF only on Docsity! CS 1331 Homework 8 Due: Friday, March 30th at 6:00pm For homework 8, you will be creating your own version of John Conway’s Game of Life. This is not a normal game – there are no players, pieces, winning or losing, simply a deterministic simulation given some starting configuration. Life was invented in the 1970s by mathematician John Conway trying to come up with a system that produced complex behavior from simple rules. This is an example of a cellular automaton, one of the hottest branches of mathematical research right now. Let’s see just how simple the rules are. Description of Game: The game consists of a two dimensional grid of cells where each cell is “alive” or “dead” (in the above screenshot, blue represents alive squares, and white represents dead cells). The game proceeds in the following manner: For all living cells: • If it has fewer than 2 neighbors, it dies of isolation • If it has more than 3 neighbors, it dies of overpopulation • Otherwise, it stays alive For all dead cells: • If it has exactly 3 neighbors, it becomes alive • Otherwise, it stays dead These simple rules are applied over and over again to produce some complex results (there are simulations online, feel free to experiment on them to get a feel for the game). Description of Assignment: In this homework, you will be implementing your own version of the game. You have complete freedom to implement it however you like, provided it meets several simple requirements. • You display a 2-d grid consisting of alive and dead cells. It must be at least 50x50, but you may make it larger if you prefer. It does not have to be fancy, but it should be similar to what is shown above – and cells should be larger than a 1x1 pixel. • You can “flip” a cell by clicking on it (for instance, if you click on a dead cell, it becomes alive; and if you click on a living cell, it dies). • You have several buttons on the side: o Randomize – this creates a random board, meaning every cell has a 50% chance of being alive or dead. o Clear – this clears whatever is on the board currently, producing a board of entirely dead cells. o Start – start the simulation o Stop – stop the simulation o You will also need a JTextField, into which a user can type an “update rate” in milliseconds. (For instance, if the user entered 100 and clicked “Start”, the program should run the simulation updating every 100 milliseconds). Suggested Design While you pretty much have free-reign on how you accomplish this (provided you do NOT copy code from the Internet), we have provided a suggested design to get you started. We will follow the MVC (Model-View-Controller) design paradigm, attempting to divorce the model from the view and control. The three integrate with each other (particularly control and view), but we have broken them into different classes to help us organize and stay Object Oriented.
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved