<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.1" -->
<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/"
	>

<channel>
	<title>prototyp.ical.ly &#187; Puzzles</title>
	<link>http://prototyp.ical.ly</link>
	<description>prototypical scriptings all over the place</description>
	<pubDate>Fri, 29 Feb 2008 11:59:53 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>
	<language>en</language>
			<item>
		<title>Stair-climbing robot</title>
		<link>http://prototyp.ical.ly/index.php/2006/12/08/stair-climbing-robot/</link>
		<comments>http://prototyp.ical.ly/index.php/2006/12/08/stair-climbing-robot/#comments</comments>
		<pubDate>Fri, 08 Dec 2006 14:28:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[Puzzles]]></category>
<category>algorithm</category><category>javascript</category><category>lamda</category><category>puzzle</category><category>robot</category>
		<guid isPermaLink="false">http://prototyp.ical.ly/index.php/2007/02/11/stair-climbing-robot/</guid>
		<description><![CDATA[A friend of mine recently posted a puzzle he took from Lambda the Ultimate and asked several people to send in possible solutions in their favourite language. My choice was Javascript naturally and I&#8217;m quite fond of it. After some discussion the solution seems to be approved by everyone included in the original thread.

Your stair-climbing [...]]]></description>
			<content:encoded><![CDATA[<p>A friend of mine recently posted a puzzle he took from <a href="http://lambda-the-ultimate.org" title="Lambda the Ultimate - The programming languages weblog">Lambda the Ultimate</a> and asked several people to send in possible solutions in their favourite language. My choice was Javascript naturally and I&#8217;m quite fond of it. After some discussion the solution seems to be approved by everyone included in the original thread.<br /></p>

<blockquote>Your stair-climbing robot has a very simple low-level API: the &#8220;step&#8221; function takes no argument and attempts to climb one step as a side effect. Unfortunately, sometimes the attempt fails and the robot clumsily <em>falls</em> one step instead. The &#8220;step&#8221; function detects what happens and returns a boolean flag: true on success, false on failure. Write a function &#8220;step_up&#8221; that climbs one step up (by repeating &#8220;step&#8221; attempts if necessary). Assume that the robot is not already at the top of the stairs, and neither does it ever reach the bottom of the stairs. How small can you make &#8220;step_up&#8221;? Can you avoid using variables (even immutable ones) and numbers?</blockquote>

<p><br />taken from <a href="http://lambda-the-ultimate.org/node/1872" title="Programming (language) puzzles">Lambda the Ultimate</a>.<br /><br /> <a href="http://prototyp.ical.ly/index.php/2006/12/08/stair-climbing-robot/#more-3" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://prototyp.ical.ly/index.php/2006/12/08/stair-climbing-robot/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
