<?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>Adam Parrish &#187; programming</title>
	<atom:link href="http://www.decontextualize.com/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.decontextualize.com</link>
	<description>decontextualize.com</description>
	<lastBuildDate>Fri, 10 Feb 2012 04:50:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Ghost equals ghost, but poison is false to steel</title>
		<link>http://www.decontextualize.com/2010/01/ghost-equals-ghost/</link>
		<comments>http://www.decontextualize.com/2010/01/ghost-equals-ghost/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 05:53:11 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[pokemon]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.decontextualize.com/?p=447</guid>
		<description><![CDATA[On top, we have a table of truth values that result when comparing values of different types in PHP. On bottom, we have a chart illustrating the strengths and weaknesses of the seventeen types of Pokémon. Is it crazy to wonder whether one might have influenced the other? The former is a matrix of arbitrary [...]]]></description>
			<content:encoded><![CDATA[<p>On top, we have a <a href="http://www.php.net/manual/en/types.comparisons.php">table of truth values</a> that result when comparing values of different types in PHP. On bottom, we have a chart illustrating <a href="http://en.wikipedia.org/wiki/Gameplay_of_Pokémon#Pok.C3.A9mon_types">the strengths and weaknesses of the seventeen types of Pokémon</a>. Is it crazy to wonder whether one might have influenced the other?</p>
<p><a href="http://www.decontextualize.com/wp-content/uploads/2010/01/php-loose-comparisons.png"><img src="http://www.decontextualize.com/wp-content/uploads/2010/01/php-loose-comparisons-300x171.png" alt="" title="php loose comparisons" width="300" height="171" class="aligncenter size-medium wp-image-448" /></a></p>
<p><a href="http://www.decontextualize.com/wp-content/uploads/2010/01/pokemon.png"><img src="http://www.decontextualize.com/wp-content/uploads/2010/01/pokemon-283x300.png" alt="" title="pokemon elemental affinity chart" width="283" height="300" class="aligncenter size-medium wp-image-449" /></a></p>
<p>The former is a matrix of arbitrary values intended to produce convenience. The latter is a matrix of arbitrary values intended to produce fun. In my experience, neither achieves its goal. But both follow an arbitrary logic, strangely twisted through history and culture, that might someday make a good subject for a Ph.D. thesis. (Why does a non-empty string equate with integer zero? Why is Psychic strong against Poison?)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.decontextualize.com/2010/01/ghost-equals-ghost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>5-in-5 Day 2: twbasic</title>
		<link>http://www.decontextualize.com/2008/07/5-in-5-day-2-twbasic/</link>
		<comments>http://www.decontextualize.com/2008/07/5-in-5-day-2-twbasic/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 04:24:03 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[retro]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.decontextualize.com/?p=35</guid>
		<description><![CDATA[(NOTE: This project is currently out of commission as I find a new place to host it and adjust the code to accommodate recent changes in the Twitter API.) My day 2 project is called twbasic. It&#8217;s an implementation of classic, line-numbered, home computer-era BASIC that runs on top of Twitter. You can start using [...]]]></description>
			<content:encoded><![CDATA[<p>(NOTE: This project is currently out of commission as I find a new place to host it and adjust the code to accommodate recent changes in the Twitter API.)</p>
<p>My day 2 project is called <i>twbasic</i>.  It&#8217;s an implementation of classic, line-numbered, home computer-era <a href="http://en.wikipedia.org/wiki/BASIC_programming_language">BASIC</a> that runs on top of Twitter.  You can start using twbasic right now by twittering your program listing to @twbasic.  Here&#8217;s how to get twenty rolls of a six-sided die:</p>
<pre>@twbasic 10 for i = 1 to val(ARG$)
@twbasic 20 print rnd(6) + 1
@twbasic 30 next i
@twbasic run 20</pre>
<p><a href="http://www.decontextualize.com/wp-content/uploads/2008/07/screenshot.png"><img src="http://www.decontextualize.com/wp-content/uploads/2008/07/screenshot-300x137.png" alt="" title="screenshot" width="300" height="137" class="aligncenter size-medium wp-image-714" /></a></p>
<p>(The above screenshot depicts twbasic providing a listing of the program above, and then the results of running the code.)</p>
<p>A reference for using twbasic can be found after the jump.</p>
<p><span id="more-35"></span><br />
<br/></p>
<h3>Twbasic Language Reference</h3>
<p>Twbasic is built on top of Malcom McLean&#8217;s liberally licensed <a href="http://www.personal.leeds.ac.uk/~bgy1mm/Minibasic/MiniBasicHome.html">MiniBasic</a>.  Twbasic supports all of MiniBasic&#8217;s keywords (see the <a href="http://www.personal.leeds.ac.uk/~bgy1mm/Minibasic/keywords.html">manual</a> for a list and explanations), with the following additions and omissions:</p>
<ul>
<li>The INPUT keyword is unsupported.  (It doesn&#8217;t make sense in the context of twitter, since there is no keyboard to retrieve input from.)
</li>
<li>An additional global variable, ARG$, is available to your program.  This variable contains the whatever string follows the <i>run</i> command (see below).
</li>
<li>Keywords are insensitive to case. (MiniBasic requires keywords in all-caps.  I found that to be annoying for use from mobile phones.)
</li>
</ul>
<p>Twbasic also limits the output of any program to 120 characters (approximately one tweet).  The server is currently set up to automatically kill any twbasic process that runs longer than fifteen seconds (so keep your programs brief).</p>
<h3>Using twbasic</h3>
<p>To use twbasic, simply start tweeting your program listing to twbasic using the reply syntax, like so:</p>
<pre>@twbasic 10 rem my first twbasic program
@twbasic 20 print "hello!"</pre>
<p>To retrieve a listing of your program, send <code>@twbasic list</code>.  Your program will be sent back to you as a reply, one line at a time.  (This might take a while.)</p>
<p>To clear your current program and start from scratch, send <code>@twbasic clear</code>.</p>
<p>You can revise a line in your program by sending another line with the same line number.  For example, if you had originally sent the program above, then sent <code>@twbasic 20 print "goodbye!"</code>, then you&#8217;d receive the following listing from <code>@twbasic list</code>:</p>
<pre>@twbasic 10 rem my first twbasic program
@twbasic 20 print "goodbye!"</pre>
<p>Once you&#8217;re satisfied with your program listing, run your program with the following syntax: <code>@twbasic run</code>.  Any characters following <code>run</code> will be available within the program as the <code>ARG$</code> variable.</p>
<p>After you&#8217;ve run your code, twbasic reply with its output (if any).  If you&#8217;re following @twbasic, the output will show up on your timeline.  If not, you&#8217;ll have to visit <a href="http://twitter.com/twbasic">twitter.com/twbasic</a>.</p>
<p>(Please be patient with twbasic: it&#8217;s only as responsive as its friendly whale master allows it to be.)</p>
<h3>Rationale</h3>
<p>The abbreviated, text-heavy and asynchronous nature of Twitter reminded me of my formative years in front of a TRS-80 Color Computer 2.  I used BASIC then, why not use it now?</p>
<p>While twbasic is mostly just a fun hack, it could potentially form the basis of a mobile, cross-platform programming platform.  Twitter&#8217;s biggest assets are its scriptability (via the excellent API) and its accessibility (if you can text, you can tweet).  So if you&#8217;re on the road somewhere with only your uncle&#8217;s crippled mobile phone, you can still use twbasic to write some trigonometry algorithms.</p>
<p>Let me know if you have any problems (that can&#8217;t be explained away by twitter&#8217;s recent flakiness) or if you come up with any ideas for interesting applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.decontextualize.com/2008/07/5-in-5-day-2-twbasic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

