<?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>SCRATCH</title>
	<atom:link href="http://manny.invigorated.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://manny.invigorated.org</link>
	<description>Attempting to develop.</description>
	<lastBuildDate>Sun, 03 Apr 2011 18:37:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Common Lisp</title>
		<link>http://manny.invigorated.org/2011/04/03/common-lisp/</link>
		<comments>http://manny.invigorated.org/2011/04/03/common-lisp/#comments</comments>
		<pubDate>Sun, 03 Apr 2011 18:00:13 +0000</pubDate>
		<dc:creator>Manny</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://manny.invigorated.org/?p=46</guid>
		<description><![CDATA[I&#8217;ll have to admit it.  I&#8217;m not much of an author.  I think everyone&#8217;s figured that out by now, though&#8230;  Anyway, I&#8217;ve been busy learning Common Lisp over the past month or so.  I&#8217;m still very shaky with it as it&#8217;s quite different than anything else I&#8217;ve programmed in.  My brother, who tries to use [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll have to admit it.  I&#8217;m not much of an author.  I think everyone&#8217;s figured that out by now, though&#8230;  Anyway, I&#8217;ve been busy learning Common Lisp over the past month or so.  I&#8217;m still very shaky with it as it&#8217;s quite different than anything else I&#8217;ve programmed in.  My brother, who tries to use Lisp (via <a title="Clojure" href="http://clojure.org/">Clojure</a>) any chance he gets, directed me towards <a title="Project Euler" href="http://projecteuler.net/">Project Euler</a> to help learn how to use the language.</p>
<p>I&#8217;ve now completed 5 problems.  None of them as efficient as I could have, but these are still the early days.  The last problem I completed was finding the sum of the digits of 100!.  For some reason, it gave me a great feeling when I completed this one.  It may be that I&#8217;m beginning to feel a bit better using Lisp or maybe that I&#8217;m not running in to as many road blocks as I was even yesterday, I dunno.  Anyway, to show it off, I&#8217;ll post the code to my &#8216;not-so-efficient&#8217; answer to problem 20:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p46code2'); return false;">View Code</a> LISP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p462"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code" id="p46code2"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> fac <span style="color: #66cc66;">&#40;</span>n<span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&lt;=</span> n <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
      '<span style="color: #cc66cc;">1</span>
    <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">apply</span> #'* <span style="color: #66cc66;">&#40;</span>loop for i from <span style="color: #cc66cc;">1</span> to n collect i<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> euler-problem-020 <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">let</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>string-version <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #66cc66;">&#40;</span>ch <span style="color: #b1b100;">nil</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #66cc66;">&#40;</span>sum <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setf</span> string-version <span style="color: #66cc66;">&#40;</span>princ-to-string <span style="color: #66cc66;">&#40;</span>fac <span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>loop for i from <span style="color: #cc66cc;">0</span> below <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">length</span> string-version<span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">do</span>
          <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setf</span> ch <span style="color: #66cc66;">&#40;</span>char string-version i<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
          <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setf</span> sum <span style="color: #66cc66;">&#40;</span>+ sum <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">parse-integer</span> <span style="color: #66cc66;">&#40;</span>princ-to-string ch<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    sum<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://manny.invigorated.org/2011/04/03/common-lisp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Purpose of This Page</title>
		<link>http://manny.invigorated.org/2010/06/12/purpose-of-this-page/</link>
		<comments>http://manny.invigorated.org/2010/06/12/purpose-of-this-page/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 17:04:05 +0000</pubDate>
		<dc:creator>Manny</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://manny.invigorated.org/?p=16</guid>
		<description><![CDATA[Thanks for coming to visit SCRATCH.  The purpose of this page is to be my public scratch pad that I would like to fill with my programming work.  Right now there isn&#8217;t much here, but with time (and as my interest dictates) there should be more things showing up.]]></description>
			<content:encoded><![CDATA[<p>Thanks for coming to visit SCRATCH.  The purpose of this page is to be my public scratch pad that I would like to fill with my programming work.  Right now there isn&#8217;t much here, but with time (and as my interest dictates) there should be more things showing up.</p>
]]></content:encoded>
			<wfw:commentRss>http://manny.invigorated.org/2010/06/12/purpose-of-this-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

