<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Raelifin.com &#187; Autocell</title>
	<atom:link href="http://raelifin.com/tag/autocell/feed/" rel="self" type="application/rss+xml" />
	<link>http://raelifin.com</link>
	<description>Deus ex Machina</description>
	<lastBuildDate>Thu, 26 Apr 2012 22:59:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Autocell 2</title>
		<link>http://raelifin.com/code/autocell-2/</link>
		<comments>http://raelifin.com/code/autocell-2/#comments</comments>
		<pubDate>Sat, 29 May 2010 16:42:22 +0000</pubDate>
		<dc:creator>Raelifin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Autocell]]></category>

		<guid isPermaLink="false">http://raelifin.com/?p=378</guid>
		<description><![CDATA[I&#8217;ve updated Autocell to version 2. In addition to cleaning up the code, adding better error handling, and (I hope) improving the interface slightly, I&#8217;ve made the following changes to the rules: You can now set cells to be drawn as images. Defining the image a cell should use is as simple as making a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://raelifin.com/files/autocell/autocell2/">I&#8217;ve updated Autocell to version 2</a>. In addition to cleaning up the code, adding better error handling, and (I hope) improving the interface slightly, I&#8217;ve made the following changes to the rules:</p>
<ul>
<li>You can now set cells to be drawn as images. Defining the image a cell should use is as simple as making a rule of &#8220;draw &lt;CELLTYPE&gt; &lt;URL&gt;&#8221; (See Langton&#8217;s Ant for example.)</li>
<li>The directions northeast, northwest, etc. have been added, as have fareast, farnorth, etc. The &#8220;far____&#8221; directions refer to cells two steps away.</li>
<li>The special noun &#8220;neighbors&#8221; now includes the NULL cells at the border.</li>
<li>New verbs &#8220;cellAt&#8221; and &#8220;neighborsOf&#8221; have been added. They both take a 2-by-1 array ([x,y]) of the cell in question as their right-parameter. The &#8220;cellAt&#8221; verb returns the type of the cell in question, while &#8220;neighborsOf&#8221; returns the set of neighbors.</li>
<li>A new two-parameter verb &#8220;+&#8221; has been added. Right now it only operates on the 2-by-1 coordinate arrays discussed above. (Example: [1,-10] + [23,7] = [24,-3])</li>
<li>In the same vein, a new special noun called &#8220;thisPos&#8221; has been added. It is the coordinates of the cell being evaluated.</li>
</ul>
<p>That&#8217;s all!</p>
]]></content:encoded>
			<wfw:commentRss>http://raelifin.com/code/autocell-2/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Mini-Project: Autocell</title>
		<link>http://raelifin.com/code/mini-project-autocell/</link>
		<comments>http://raelifin.com/code/mini-project-autocell/#comments</comments>
		<pubDate>Thu, 20 May 2010 06:12:27 +0000</pubDate>
		<dc:creator>Raelifin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Autocell]]></category>
		<category><![CDATA[cellular automata]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[rapid-prototype]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://raelifin.com/?p=356</guid>
		<description><![CDATA[My latest quick project was to write a basic scripting language for building cellular automata. The framework is built on javascript, and I made a nice little interface to go with it. As long as you&#8217;re using a browser that isn&#8217;t terrible, you can check it out here. All the code on that page except [...]]]></description>
			<content:encoded><![CDATA[<p><img style="margin: 0 0 10px 10px; float: right;" src="http://raelifin.com/files/screenshots/autocell_screenshot.png"/>My latest quick project was to write a basic scripting language for building <a href="http://en.wikipedia.org/wiki/Cellular_automata">cellular automata</a>. The framework is built on javascript, and I made a nice little interface to go with it. As long as you&#8217;re using a browser that isn&#8217;t terrible, you can <a href="http://raelifin.com/files/autocell1.html">check it out here</a>. All the code on that page except the utility functions is public domain, but please give credit where credit is due. If you end up examining the source, I apologize for the mess; I was trying to fit everything in one file, and not use jQuery or other libraries.</p>
<p><span id="more-356"></span></p>
<p>For those interested in writing your own automata, here is a quick guide to the syntax:<br />
An automaton is composed of rules. Each rule is designated by a new line. Double slash (//) or pound (#) designate a commented line.<br />
Each rule looks something like <strong>BLACK->WHITE: 1 = 2</strong><br />
BLACK is the type of cell that the rule applies to, WHITE is the type of cell that it will become. After the colon is a statement that must resolve to a single value, or &#8220;noun&#8221;.<br />
Nouns can be strings, numbers, true/false, JSON arrays, &#8220;neighbors&#8221;, or any of the cardinal directions (lower-case). The noun &#8220;neighbors&#8221; is a special noun which is a JSON array with values equal to the types of the surrounding tiles (in eight directions). The special nouns &#8220;west&#8221;, &#8220;north&#8221;, &#8220;south&#8221; and &#8220;east&#8221; are equal to the type in that direction, or &#8220;NULL&#8221; if at the edge.<br />
Nouns can be acted upon by the following &#8220;verbs&#8221;:
<ul>
<li><strong>=</strong>, <strong>></strong>, <strong><</strong> &#8212; Basic comparison operators. They behave like their counterparts in javascript (except for =, which is comparison, not assignment). &#8212; example: &#8220;1 > 2 = false&#8221; (returns true)</li>
<li><strong>or</strong>, <strong>and</strong> &#8212; Low-priority logic operators. These behave like || and &#038;&#038; in most languages. Low-priority means they are evaluated after other verbs. &#8212; example: &#8220;true and false or true&#8221; (returns true)</li>
<li><strong>not</strong> &#8212; Inverts the boolean value to the right. If the value to the right is non-boolean, it is cast to a boolean just like ! in javascript. &#8212; example: &#8220;not true&#8221; (returns false)</li>
<li><strong>contains</strong>, <strong>isIn</strong> &#8212; Check if a value is contained in an array. The two verbs are identical except in the order of their parameters (&#8220;value isIn array&#8221;, or &#8220;array contains value&#8221;). &#8212; example: &#8220;[1,2,3] contains 0&#8243; (returns false)</li>
<li><strong>count</strong> &#8212; Changes the noun on the right from an array to an integer. &#8212; example: &#8220;count [0,1,2]&#8221; (returns 3)</li>
<li><strong>ofType</strong> &#8212; Filters an array on the left to only contain the value on the right. &#8212; example: &#8220;[0,0,0,1,2,3] ofType 0&#8243; (returns [0,0,0])</li>
<li><strong>echo</strong> &#8212; Makes a popup containing the value on the right. Does not change the data. This verb isn&#8217;t very useful, and can flood your browser with popups if you aren&#8217;t careful.</li>
</ul>
<p>Verbs are evaluated from left-to-right, but you can use parentheses to change the order of operations. More examples can be found by loading the prebuilt automata.</p>
<p>I know the interface is a bit hard to use, but if you make anything (even if it&#8217;s pretty trivial) please leave a comment! You can export boards as well, so feel free to share interesting formations in <a href="http://en.wikipedia.org/wiki/Conway's_Game_of_Life">Conway&#8217;s Game of Life</a>, <a href="http://en.wikipedia.org/wiki/Wireworld">Wireworld</a>, or others.</p>
<p>On a related note, this talk by Wolfram is not to be missed:<br />
<object width="446" height="326"><param name="movie" value="http://video.ted.com/assets/player/swf/EmbedPlayer.swf"></param><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always"/><param name="wmode" value="transparent"></param><param name="bgColor" value="#ffffff"></param><param name="flashvars" value="vu=http://video.ted.com/talks/dynamic/StephenWolfram_2010-medium.flv&#038;su=http://images.ted.com/images/ted/tedindex/embed-posters/StephenWolfram-2010.embed_thumbnail.jpg&#038;vw=432&#038;vh=240&#038;ap=0&#038;ti=843&#038;introDuration=15330&#038;adDuration=4000&#038;postAdDuration=830&#038;adKeys=talk=stephen_wolfram_computing_a_theory_of_everything;year=2010;theme=tales_of_invention;theme=bold_predictions_stern_warnings;theme=what_s_next_in_tech;theme=new_on_ted_com;theme=a_taste_of_ted2010;theme=unconventional_explanations;theme=art_unusual;theme=inspired_by_nature;event=TED2010;&#038;preAdTag=tconf.ted/embed;tile=1;sz=512x288;" /><embed src="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" pluginspace="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" bgColor="#ffffff" width="446" height="326" allowFullScreen="true" allowScriptAccess="always" flashvars="vu=http://video.ted.com/talks/dynamic/StephenWolfram_2010-medium.flv&#038;su=http://images.ted.com/images/ted/tedindex/embed-posters/StephenWolfram-2010.embed_thumbnail.jpg&#038;vw=432&#038;vh=240&#038;ap=0&#038;ti=843&#038;introDuration=15330&#038;adDuration=4000&#038;postAdDuration=830&#038;adKeys=talk=stephen_wolfram_computing_a_theory_of_everything;year=2010;theme=tales_of_invention;theme=bold_predictions_stern_warnings;theme=what_s_next_in_tech;theme=new_on_ted_com;theme=a_taste_of_ted2010;theme=unconventional_explanations;theme=art_unusual;theme=inspired_by_nature;event=TED2010;"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://raelifin.com/code/mini-project-autocell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

