Click here to Skip to main content
15,861,168 members
Articles / Programming Languages / C#
Article

Game Of Life 2 Life Wars

Rate me:
Please Sign up or sign in to vote.
4.11/5 (8 votes)
29 Sep 20032 min read 76.3K   1.4K   27   9
A variation on the Game Of Life Theme

Introduction

The Game Of Life 2 Life Wars comes from the idea of the original Game of Life program and wondering what would happen if you put another set of critters in there and let them compete for the space just to see what would happen. The program has two modes, the original Game of Life with options to change the rules on the fly and the life wars mode which you can either run on a random setting which generates your critters for you or an edit mode in which you place your critters on the squares yourself.

Image 1

The Game Of Life

The Game Of Life mode starts with a hundred randomly generated critters on the form and then uses the rule that if there are 3 squares next to a square that are occupied then the square will grow a new critter. However if there are less than 2 squares next to any square that contains a critter that are occupied then the critter will get lonely and die. Also if there are 3 squares or more that contain critters next to a critter then that critter will get overcrowded and die.

These options are updateable in real time, with of course, the exception of the starting number of critters. So you can change the rules as the program runs and either encourage their survival or wipe them out completely.

Image 2

Life Wars

In the Life Wars mode the player is the white color and the computer is the pinky color, well dark salmon anyway. Both the computer and the player have the same number of starting critters and the player can choose to let the computer randomly set up their critters or they can turn off the random placement check box and place their critters on the squares themselves.

The rules for Life Wars are the same as the rules for the Game Of Life with the exception that when a square generates a new critter, the color of the critter is determined by the side of the critters around it, so if the computer has more critters then it will be the computer's square and vice versa. If however both the player and the computer have the same number of critters surrounding the square then the side that the critter is on will be randomly generated.

Image 3

The main options tab page allows the player to choose which mode they are going to use and has three buttons which start the game in whatever mode that has been chosen and will pause the game, with the final button allowing the player to reset the game for another go.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Questiongame of life 50 generations Pin
capridania6-Mar-08 17:19
capridania6-Mar-08 17:19 
Generalgame of life Pin
BillyB2133-Jun-07 22:27
BillyB2133-Jun-07 22:27 
GeneralTrick Pin
Cap'n Code18-Jun-04 9:29
Cap'n Code18-Jun-04 9:29 
GeneralRe: Trick Pin
pseudonym6718-Jun-04 19:22
pseudonym6718-Jun-04 19:22 
QuestionSame number of critters? Pin
James Curran7-Oct-03 1:07
James Curran7-Oct-03 1:07 
AnswerRe: Same number of critters? Pin
pseudonym677-Oct-03 2:11
pseudonym677-Oct-03 2:11 
GeneralSolution Won't Open Pin
garythom_work30-Sep-03 10:39
garythom_work30-Sep-03 10:39 
GeneralRe: Solution Won't Open Pin
pseudonym6730-Sep-03 12:44
pseudonym6730-Sep-03 12:44 
GeneralRe: Solution Won't Open Pin
netclectic30-Sep-03 22:22
netclectic30-Sep-03 22:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.