Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

The 20 Line Challenge / Game of life

Author
Message
Rapidrory
9
Years of Service
User Offline
Joined: 21st Aug 2009
Location:
Posted: 14th Aug 2010 03:09 Edited at: 14th Aug 2010 03:28
This is a 7 line vertion of John Conway's 'Game of life'.

Game of life is a simple set of 4 rules which govern 'cells' in a life like way.

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

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

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

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

You input the starting pattern using the mouse (left click creates a live cell, right click removes a live cell) and once a pattern has been entered, press the spacebar and the pattern will then evolve based on the rules above.

There is a good wikipedia article on it which goes into much more detail about it.



There is no such thing as "Too Fast!"
IBOL
Moderator
14
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 15th Aug 2010 07:11
i checked this out earlier today and it is awesome!

i've made several DBP "life" variations;
it's such a fascinating concept.

nice going !

here's the wiki link:
http://en.wikipedia.org/wiki/Conway's_Game_of_Life

Rapidrory
9
Years of Service
User Offline
Joined: 21st Aug 2009
Location:
Posted: 15th Aug 2010 12:09
Thanks IBOL

i've done several updates to it now, so i'll post the updated code:



You now hold the spacebar to edit, and spacebar+ctrl resets the game.

you can change the grid size by scrolling the mouse wheel whilst holding spacebar and ctrl.

There is no such thing as "Too Fast!"
29 games
13
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 23rd Aug 2010 19:36
I've always liked Conway's game of life. It can be very hypnotic to watch.

Nice work.
Daygamer
8
Years of Service
User Offline
Joined: 16th Mar 2010
Location: United States
Posted: 24th Aug 2010 07:40
For 7 lines, it kept me interested for a long time. great snippet

yrotate when you can spin?
God Bless!

Login to post a reply

Server time is: 2018-12-17 03:03:17
Your offset time is: 2018-12-17 03:03:17