[Staff][Beta] Conway's Game of Life!

Here you can find side projects of the staff and great projects which we think should get extra support. (Note that featured projects are not projects by staff members of MaxCoderz)

Moderator: MaxCoderz Staff

User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4128
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

[Staff][Beta] Conway's Game of Life!

Post by tr1p1ea »

You may have heard of "Conway's Game of Life" before, if not, well it is possibly the most famous example a cellular automaton. It was initially thought up by the British mathematician John Horton Conway in 1970.

Basically what you do is take every pixel on the screen and apply the following rules:

1: Any live cell with < 2 neighbours dies of loneliness
2: Any live cell with > 3 neighbours dies of overcrowding
3: Any dead cell with exactly 3 neighbours is bought to life
4: Any live cell with 2 or 3 neighours remains unchanged
Note: births and deaths can occur during 1 generation

More information can be found here: http://en.wikipedia.org/wiki/Conways_Game_of_Life

Simply put, you can make patterns that evolve into stuff :).

Sounds easy enough? But testing the 8 surrounding pixels for the 6144 pixels on the calc screen isnt ever going to be lightning fast. Iambian came up with an implementation a little while ago that involved some genius shifting and such, and he managed to get things running at a decent speed.

For some reason he mentioned it on IRC, that he would like to see it faster but didnt know if that was likely. I couldnt get this conway's thing out of my head so i had a go. With the aid of some page-aligned LUT's and some optimising i managed to get an implementation going. Making me happy that it actually works, and even happier that it runs at a decent speed.

I slapped some PIC loading in and a cheap titlescreen and it seems to be all done. I was just wondering if anyone wanted to test it for me? Just indicate in this thread if you do, state your email address and i will send it to you.

Screenshots:
Image Image
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
Liazon
Calc Guru
Posts: 962
Joined: Thu 27 Oct, 2005 8:28 pm

Post by Liazon »

looks good :)

the famous glider maker!
Image Image Image
Floodkiller
Sir Posts-A-Lot
Posts: 245
Joined: Mon 14 Nov, 2005 9:47 pm
Location: Getting overwhelmed by everything
Contact:

Post by Floodkiller »

Looks cool!
Main Projects:
Zombie Attack: 20%

Side Projects:
???-25%

Image

Staff member of Hikaru Rakuen Programming.
merthsoft
Extreme Poster
Posts: 496
Joined: Tue 21 Dec, 2004 6:49 am
Location: WI

Post by merthsoft »

I f-ing love Conways game of life
Mcfall_s
@
denison.
ed
u

I break it up 'cause I don't want spam, not to piss ypou off...
Shaun
User avatar
Dwedit
Maxcoderz Staff
Posts: 579
Joined: Wed 15 Dec, 2004 6:06 am
Location: Chicago!
Contact:

Post by Dwedit »

Your email address is already linked from the Email button at the bottom of your post :)
You know your hexadecimal output routine is broken when it displays the character 'G'.
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4128
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Okay, so there is this new algorithm that might speed things up. Im also trying to decide on whether or not to include wrapping ... what do you guys think?
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
benryves
Maxcoderz Staff
Posts: 3078
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

I'm up for testing, as mentioned in IRC. :)
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4128
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

I noticed that there was a Conway's game for the 86 by Josh Seagoe that boasted ~6fps. I thought that was pretty impressive as mine get ~5.5fps, but the 86 has a larger screen. His algorithm is actually very ingenious, but the implementation needed improving a bit. So using the best of both algo's i have come up with an implementation that can process a full frame in ~600,000cc's. Which is a significant improvement over my old 1.1million cc's per frame :).

Here you can see the difference:
Image Image

Left is old, right is new.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
merthsoft
Extreme Poster
Posts: 496
Joined: Tue 21 Dec, 2004 6:49 am
Location: WI

Post by merthsoft »

Haha, I thought that was my old email on my profile, time to remove that :D
Shaun
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

It looks like it's twice as fast (11/6 is almost 2 anyway)

It looks cool and those gliders remind me of the origin of the hacker-symbol ;)
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4128
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Im pretty sure the accepted hacker symbol is that glider.

Also i optimised it further, its down to ~526,000cc's per frame now :). I still have to special case some things to fix wrapping errors in the corners, but it is lightning on the SE :).
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
cartj
New Member
Posts: 51
Joined: Tue 17 Oct, 2006 10:49 pm
Location: North West U.S.

Post by cartj »

I love the game of life! I didn't know what it was the first time I played it but it got really addicting so yeah, I'll test it. Looks great by the way.

Edit:
Sorry, wrong email address. Use this one.
-jaco_3737@yahoo.com
Last edited by cartj on Fri 02 Mar, 2007 3:14 am, edited 1 time in total.
Liazon
Calc Guru
Posts: 962
Joined: Thu 27 Oct, 2005 8:28 pm

Post by Liazon »

even at 6 fps it still looks awesome!
Image Image Image
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4128
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Okay, well i think i have pretty much finished it so you can find a pre-release here:

http://www.ticalc.org/archives/files/fi ... 39705.html

(Included is 83 and 83/4+(SE) versions, plus an example PIC)

I would appreciate if people could test it and then provide me with information such as: Your calc type, OS version, any problems/suggestions.

Thanks heaps :).
Last edited by tr1p1ea on Wed 14 Mar, 2007 9:20 am, edited 1 time in total.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
cartj
New Member
Posts: 51
Joined: Tue 17 Oct, 2006 10:49 pm
Location: North West U.S.

Post by cartj »

Calc:
- ti-84 plus se
-os 2.21

Comments:
I have not seen any problems at all. It is blazing fast and easy to use. All I can think of that would make it better is an in-game pic-editor if yo have the time. Great job and I'm looking forward to the final release.

Here is a screenshot of my favorite design I've made so far It looks better on the calc though:
Image
(it is full quality so firefox should be used for best viewing)
Post Reply