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 / [DBP] - A 1-D cellular automata program

Author
Message
Neuro Fuzzy
15
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 11th Dec 2011 04:07
Just something I made when I was bored. 1d Cellular automata are a great example of how simple rules can give rise to complex behaivour. What a cellular automata is is described well here: http://math.hws.edu/xJava/CA/CA.html

Rules 30, 106 and 110 are my favorites. I think that for every pattern, there's an inverse (swap all white with black), a mirror (flip about the starting node) and an inverse mirror, so even though there are 256 different rules, there are only 64 distinct ones. (don't quote me on that though)


Press up/down to change the ruleset
press right/left to change the starting row to be either random or a single point. Random is usually more interesting.



MrValentine
AGK Backer
11
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 11th Dec 2011 18:00
Neuro... remind me to show you that shopping picture I got for you

Zotoaster
17
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 15th Dec 2011 00:45
I saw Stephen Wolfram talk about these at a TED conference once. He pointed out that if you look at rule 30 (at least it's 30 in this case), without randomising the first row, you get what appears to be an irregular pattern, unlike all the others. This pattern's been found all over nature, it's quite an interesting subject.

"everyone forgets a semi-colon sometimes." - Phaelax
Neuro Fuzzy
15
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 15th Dec 2011 02:11
Yeah, one of his talks inspired me to make this program. I'm pretty sure that rule 30 is just one of the ones that exhibits an irregular pattern. Wikipedia says that rule 110 is turing complete, so it's capable of universal computation. eg you can have a computer running using the rules of wolfram rule 110 (slowly of course xD). So some of the patterns exhibit regularity (and so can be reduced, as is apparent with the sierpinski triangle looking automata), and some of them (like rule 30 and 110) cannot be reduced, eg the only way to find a given row is to compute every row beforehand.

It makes me want to study theoretical computer science

Libervurto
16
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 4th Feb 2012 18:56
I managed to simplify it a bit. (PUN!)



Nice code, really interesting

Join DNG today! We are a game development team open to all. Visit our Headquarters to learn more.

Login to post a reply

Server time is: 2022-12-01 13:39:35
Your offset time is: 2022-12-01 13:39:35