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.

Code Snippets / Conaway's Life Game

Author
Message
Uber Krystoff
20
Years of Service
User Offline
Joined: 3rd Feb 2004
Location:
Posted: 4th Feb 2004 03:56
This is one of the first algorithms ever "written." It was actually developed by some mathmatitions at oxford... or something... but anyways its a very simple way to simulate how cells live. If a "cell" (dot) is being touched by more than 3 cells it dies of crowding, and less than 3 it dies of overexposure. This is very interesting (although extremely freak'n slow) and actually looks like cells or mabey a forest growing after a while.

256k ought to be enough for anybody
-Bill Gates
Slayer
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: CA
Posted: 5th Feb 2004 07:23
Dose not work.

I dont know how to spell
Quix
20
Years of Service
User Offline
Joined: 20th Jan 2004
Location: California
Posted: 5th Feb 2004 08:29 Edited at: 5th Feb 2004 08:40
I did this one too. In fact it was the first thing I did with Darkbasic Pro after buying it. I haven't programmed anything for over ten years and the last language I used was pascal and the bare surface of C.

The "Game" was written by John Conway, a mathematician, and it is supposed to represent a sort of survival of cells. Actually it's a good represntation of how simple causes can have large results seemingly independent of the cause. Sort of an analogy of life. That's why it's often called Conway's game of Life.

Rules:
Isolated cells (one neighbor or less) die of loneliness, and crowded cells (4 or more neighbors) die of overcrowding. A blank space with three neighbors spawns a new cell.

I attached my code....some of it shows that I was at an early stage of learning this software, so please excuse blatant crap code. >>RETURN<< key resets it.

Oh..I also did a 3D version that you can fly through while it's going and the problem is they never die! hehe...not really a problem...


Quix
Uber Krystoff
20
Years of Service
User Offline
Joined: 3rd Feb 2004
Location:
Posted: 9th Feb 2004 02:23
dammit i wish i could see it, looks really good! alas! I don't have Dark Basic Pro only Enhanced. Oh well sux 4 me, i'm just too lazy to actually buy it.

There are 10 types of people in the world, those who understand binary and those who don't.
TheCyborg
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 11th Feb 2004 16:22
Heres a working version for DBP

You might want to make it use memblocks to make it faster

Member of Tjald - Targeted Joint Addicted Liberation Diplomacy

I am (currently) 42% addicted to Counter-Strike. What about you?
Kwiki Mart
20
Years of Service
User Offline
Joined: 9th Dec 2003
Location: PA
Posted: 12th Feb 2004 17:34
What the heck does it do?

AMD Athlon 64 3200+, 512 Megs of Ram, ATI Radeon 9600 128MB, 160GB HD
TheCyborg
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 17th Feb 2004 15:51
It simulates life...

Member of Tjald - Targeted Joint Addicted Liberation Diplomacy

I am (currently) 45% addicted to Counter-Strike. What about you?
Dennuz666 v2
20
Years of Service
User Offline
Joined: 21st Jan 2004
Location: Netherlands
Posted: 17th Feb 2004 16:40
Well... i don't know who's life this is but... it isn't very much fun. The screen stays black and it doesn't do anything. Hmm... sounds like mine

I use DBP by the way.

F*ck it all, no regrets!!!
Damokles
20
Years of Service
User Offline
Joined: 28th May 2003
Location: Belgium
Posted: 17th Feb 2004 19:22
I remmber that thing : I had to do it the first year I went to University, in ThinkPascal. The funny thing was that the teacher could do such things, but couldn'T change the color of it.

"Begin at the beginning, and go on till you come to the end: then stop." - Lewis Carroll

Login to post a reply

Server time is: 2024-05-12 11:07:13
Your offset time is: 2024-05-12 11:07:13