



<?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>Rannsaich mo Inntinn &#187; Multi-part Series</title>
	<atom:link href="http://blog.tsmacdonald.com/archives/category/multi-part-series/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.tsmacdonald.com</link>
	<description></description>
	<lastBuildDate>Wed, 15 Dec 2010 01:39:10 +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>An Object-Oriented Primer in Python: Part 1</title>
		<link>http://blog.tsmacdonald.com/archives/235</link>
		<comments>http://blog.tsmacdonald.com/archives/235#comments</comments>
		<pubDate>Wed, 18 Feb 2009 23:44:43 +0000</pubDate>
		<dc:creator>Timmy</dc:creator>
				<category><![CDATA[Multi-part Series]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.tsmacdonald.com/?p=235</guid>
		<description><![CDATA[I&#8217;ve read several tutorials on Object-Oriented Programming (OOP), and none of them has been as clear as I thought they should be. So it took me a long time to figure out OOP, and now I feel like I should pass on the knowledge. Here it is: Objects One of the main difficulties in OOP [...]<p><!-- Beginning of Project Wonderful ad code: -->
<!-- Ad box ID: 34641 -->
<script type="text/javascript">
<!--
var d=document;
d.projectwonderful_adbox_id = "34641";
d.projectwonderful_adbox_type = "1";
d.projectwonderful_foreground_color = "";
d.projectwonderful_background_color = "";
//-->
</script>
<script type="text/javascript" src="http://www.projectwonderful.com/ad_display.js"></script>
<!-- End of Project Wonderful ad code. --></p>
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve read several tutorials on Object-Oriented Programming (OOP), and none of them has been as clear as I thought they should be. So it took me a long time to figure out OOP, and now I feel like I should pass on the knowledge. Here it is:</p>
<p><strong>Objects</strong></p>
<p>One of the main difficulties in OOP is <em>thinking</em> about it. So start trying to wrap your mind around an object. Basically, an object is a specialized data structure than can <strong>hold</strong> information, and <strong>do</strong> things with it. In other words, it&#8217;s a <em>thing</em> represented by code. And you aren&#8217;t limited to just one thing, you can have as many as you want, just as you can have as many numbers, lists or dictionaries as you want.</p>
<p><strong>Holding Information and Doing Things<br />
</strong></p>
<p>You can give objects attributes. What&#8217;s even cooler is that you can access them really specifically:</p>
<pre>fido = Dog("Golden Retriever")
fido.breed</pre>
<p>Assuming you&#8217;ve made a &#8220;Dog&#8221; class, fido.breed will be a string saying &#8220;Golden Retriever.&#8221; You can also change the data (it&#8217;d be pretty pointless if you couldn&#8217;t&#8230;) :</p>
<pre>&gt;&gt;&gt; fido = Dog("Golden Retriever")
&gt;&gt;&gt; fido.showBreed()
It's a Golden Retriever
&gt;&gt;&gt; fido.breed = "Labrador"
&gt;&gt;&gt; fido.showBreed()
It's a Labrador
&gt;&gt;&gt; fido.changeBreed("Dalmatian")
&gt;&gt;&gt; fido.showBreed()
It's a Dalmatian
&gt;&gt;&gt; fido.breed
'Dalmatian'</pre>
<p>Here we make a Golden Retriever named fido. We have it call a method (OOP-speak for function) to say what breed it is, and then change it&#8217;s breed variable to &#8220;Labrador.&#8221; After that, we use a different method (yes, objects can have multiple methods) to change the breed to &#8220;Dalmatian,&#8221; and have fido tell us that he is, in fact, a Dalmatian. If you feel like having to prefix everything with &#8220;fido.&#8221; is annoying, don&#8217;t worry: There&#8217;s a reason. We could just as easily have:</p>
<pre>&gt;&gt;&gt; fido = Dog("Golden Retriever")
&gt;&gt;&gt; spot = Dog("Mutt")
&gt;&gt;&gt; fido.showBreed()
It's a Golden Retriever
&gt;&gt;&gt; spot.showBreed()
It's a Mutt</pre>
<p>If we just used a generic &#8216;showBreed()&#8217; method, Python wouldn&#8217;t know whether we were talking about fido or spot, or some other dog. The &lt;name&gt;&lt;dot&gt; system is a pretty efficient way of telling Python who&#8217;s doing what, or who&#8217;s remembering what.</p>
<p>Look back over this section and make sure you understand it well: We made an <em>instance</em> of the Dog <em>class</em>, which <em>held information</em> (fido.breed) and <em>did things</em> (fido.showBreed()), we also made another instance of the <em>same Dog class</em> (spot), which held different, but similar information (Mutt instead of Golden Retriever), and did similar things (said what breed he, spot, was, as opposed to what fido was).</p>
<p>Obviously stuff can get a lot more complicated, but if you understand that, you&#8217;re doing fine!</p>
<p>~Read <a href="http://blog.tsmacdonald.com/archives/238">Part 2</a> to learn how to <em>make</em> classes~<br />
<script type="text/javascript"><!--
  reddit_url = "http://blog.tsmacdonald.com/archives/235";
// --></script><br />
<script src="http://www.reddit.com/r/programming/button.js?t=3" type="text/javascript"></script></p>
<p><!-- Beginning of Project Wonderful ad code: -->
<!-- Ad box ID: 34641 -->
<script type="text/javascript">
<!--
var d=document;
d.projectwonderful_adbox_id = "34641";
d.projectwonderful_adbox_type = "1";
d.projectwonderful_foreground_color = "";
d.projectwonderful_background_color = "";
//-->
</script>
<script type="text/javascript" src="http://www.projectwonderful.com/ad_display.js"></script>
<!-- End of Project Wonderful ad code. --></p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=Rannsaich%20mo%20Inntinn&amp;siteurl=http%3A%2F%2Fblog.tsmacdonald.com%2F&amp;linkname=An%20Object-Oriented%20Primer%20in%20Python%3A%20Part%201&amp;linkurl=http%3A%2F%2Fblog.tsmacdonald.com%2Farchives%2F235" target="_blank"><img src="http://blog.tsmacdonald.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://blog.tsmacdonald.com/archives/235/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TI-BASIC (Round Three) (Control Flow: If-Then-End)</title>
		<link>http://blog.tsmacdonald.com/archives/40</link>
		<comments>http://blog.tsmacdonald.com/archives/40#comments</comments>
		<pubDate>Tue, 30 Sep 2008 15:45:18 +0000</pubDate>
		<dc:creator>Timmy</dc:creator>
				<category><![CDATA[Multi-part Series]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[calculator programming]]></category>
		<category><![CDATA[TI-BASIC]]></category>

		<guid isPermaLink="false">http://tmac.andrewmin.com/blog/?p=40</guid>
		<description><![CDATA[Consider the following code: 1-&#62;A If A = 1 Disp "A=1" Let&#8217;s study it a bit. The first line just stores 1 as A. Standard stuff. The second line is freaky, and the third line just displays &#8220;A=1&#8243;. Standard stuff. Let&#8217;s go back to the freaky part. It introduces one of the more powerful commands [...]<p><!-- Beginning of Project Wonderful ad code: -->
<!-- Ad box ID: 34641 -->
<script type="text/javascript">
<!--
var d=document;
d.projectwonderful_adbox_id = "34641";
d.projectwonderful_adbox_type = "1";
d.projectwonderful_foreground_color = "";
d.projectwonderful_background_color = "";
//-->
</script>
<script type="text/javascript" src="http://www.projectwonderful.com/ad_display.js"></script>
<!-- End of Project Wonderful ad code. --></p>
]]></description>
			<content:encoded><![CDATA[<p>Consider the following code:</p>
<pre>1-&gt;A</pre>
<pre>If A = 1
Disp "A=1"</pre>
<p>Let&#8217;s study it a bit. The first line just stores 1 as A. Standard stuff. The second line is freaky, and the third line just displays &#8220;A=1&#8243;. Standard stuff. Let&#8217;s go back to the freaky part. It introduces one of the more powerful commands in TI-BASIC: If. What it says, is that <em>if</em> A equals 1, to do something. The syntax isn&#8217;t nearly as remarkable as the code, just If [value][thingy][value]. Thingy can be anything from the &#8216;Test&#8217; menu. =, &lt;, &gt;, etc.</p>
<p><em>Note: Due to the constraints of this keyboard, the less-than-or-equal-to sign will be written as &lt;=, and the greater-than-or-equal-to sign will be written as &gt;=. Also, the not-equal-to sign will be written as !=.</em></p>
<p>If you&#8217;re looking for &#8216;if&#8217;, it&#8217;s under &#8216;Ctl&#8217;, not &#8216;I/O&#8217;. And this is the first time we&#8217;re using &#8216;Ctl&#8217;&#8230;Yay! OK, digression over <img src='http://blog.tsmacdonald.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If&#8217;s power comes from the fact that it introduces uncertainty into the program. This means the program can rocket off in a lot more directions, which means: <em>Sweeeeeeet</em>.</p>
<p>Since you handled that chunk of code so beautifully, let&#8217;s consider this one too.</p>
<pre>Input A
If A=1
Disp "A=1"
Disp "Where is this?"</pre>
<p>I hope you&#8217;re wondering if the &#8216;Where is this?&#8217; line is part of the if statement or not. It&#8217;s not. The only command that&#8217;s conditional is the one immediately after the if line. Which is really useful for a code snippet like this:</p>
<pre>If A=1
Disp "A is 1"
If A=2
Disp "A is 2"
If A&gt;2
Disp "A is pretty big"
If A&lt;1
Disp "A is pretty small"

That's a lot cleaner than the following method, which is also legal.</pre>
<pre>If A=1
Then
Disp "A is 1"
End
If A=2
Then
Disp "A is 2"
End
If A&gt;2
Then
Disp "A is pretty big"
End
If A&lt;1
Then
Disp "A is pretty small"
End</pre>
<p>You&#8217;re probably wondering <em>why</em> that&#8217;s legal. It&#8217;s stinking huge! Which brings us back to our problem&#8211;if only lasts for a line. If-Then-End fixes that problem. Then means that all of the following instructions are only to happen if the statement is true, and End means that an end has been put to the conditional instructions. There&#8217;s no <em>arguments</em> required for Then or End (an argument is something that has to be put with it to make the syntax legal.) So let&#8217;s look at our &#8216;Guess!&#8217; program again. Last time we&#8217;d gotten this far:</p>
<pre>Disp "Guess!","","(GPL) 2008", "T. Macdonald"</pre>
<pre>#Note that going from the outline to the implementation there was a better idea--putting 'Guess!' and the GPL on separate lines.
Input "Guess:".G
#Oh no! We don't know how to make a random number!
#Oh no! We don't know how to say if the number is too big or too small!
#(That's why the tutorial's not done. Stay tuned.)

And now we do know how to say if a number is too big or too small!
So
#I'm not copying all the code, we'll pick it up here:
Input "Guess:", G
If G&lt;R
Disp "Too small!"
If G&gt;R
Disp "Too big!"
If G=R
Disp "You win!"</pre>
<p>Unfortunately, that&#8217;s really all we can do with that, as of right now.<br />
Next time we&#8217;ll talk about Else.</p>
<p>Assignment: Write a program that will ask the user for his age, and then will classify them as &#8220;Kid&#8221; (12 and under), &#8220;Teenager&#8221; (13-19) or &#8220;Adult&#8221; (20+).</p>
<p><!-- Beginning of Project Wonderful ad code: -->
<!-- Ad box ID: 34641 -->
<script type="text/javascript">
<!--
var d=document;
d.projectwonderful_adbox_id = "34641";
d.projectwonderful_adbox_type = "1";
d.projectwonderful_foreground_color = "";
d.projectwonderful_background_color = "";
//-->
</script>
<script type="text/javascript" src="http://www.projectwonderful.com/ad_display.js"></script>
<!-- End of Project Wonderful ad code. --></p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=Rannsaich%20mo%20Inntinn&amp;siteurl=http%3A%2F%2Fblog.tsmacdonald.com%2F&amp;linkname=TI-BASIC%20%28Round%20Three%29%20%28Control%20Flow%3A%20If-Then-End%29&amp;linkurl=http%3A%2F%2Fblog.tsmacdonald.com%2Farchives%2F40" target="_blank"><img src="http://blog.tsmacdonald.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://blog.tsmacdonald.com/archives/40/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TI-BASIC (Round Two-and-a-Half) (More with Input)</title>
		<link>http://blog.tsmacdonald.com/archives/27</link>
		<comments>http://blog.tsmacdonald.com/archives/27#comments</comments>
		<pubDate>Sat, 27 Sep 2008 17:07:42 +0000</pubDate>
		<dc:creator>Timmy</dc:creator>
				<category><![CDATA[Multi-part Series]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[BASIC]]></category>
		<category><![CDATA[calculator programming]]></category>
		<category><![CDATA[TI-BASIC]]></category>

		<guid isPermaLink="false">http://tmac.andrewmin.com/blog/?p=27</guid>
		<description><![CDATA[The somewhat astute among us have noticed that in Round *, there was the following line of code: Input "Guess:",G And that I haven&#8217;t explained how that works. The pretty astute among us have also noticed that when they run a program such as the following: Input G All that&#8217;s shown is a question mark, [...]<p><!-- Beginning of Project Wonderful ad code: -->
<!-- Ad box ID: 34641 -->
<script type="text/javascript">
<!--
var d=document;
d.projectwonderful_adbox_id = "34641";
d.projectwonderful_adbox_type = "1";
d.projectwonderful_foreground_color = "";
d.projectwonderful_background_color = "";
//-->
</script>
<script type="text/javascript" src="http://www.projectwonderful.com/ad_display.js"></script>
<!-- End of Project Wonderful ad code. --></p>
]]></description>
			<content:encoded><![CDATA[<p>The somewhat astute among us have noticed that in Round *, there was the following line of code:</p>
<pre>Input "Guess:",G</pre>
<p>And that I haven&#8217;t explained how that works.</p>
<p>The pretty astute among us have also noticed that when they run a program such as the following:</p>
<pre>Input G</pre>
<p>All that&#8217;s shown is a question mark, and it&#8217;s not very visually appealing.</p>
<p>The quite astute among us have already realized that the way to get rid of the ugly question mark, and replace it with something more attractive is to put the attractive message in quotes, follow it with a comma, and then tack the variable name to the end of it.</p>
<p>Those who are not feeling very astute should be please that the astute have shared their thoughts, and we&#8217;re all back on a level playing field.</p>
<p>Finally, the EXTREMELY astute people are saying to themselves &#8220;It is <em>such</em> a drag when there&#8217;s like four variables that the user has to put in, and I have to make <em>four</em> Input statements. Four! Can you imagine? Surely there&#8217;s an easier way.&#8221;</p>
<p>Meet Input&#8217;s big brother &#8216;Prompt&#8217;. (TI-BASIC is very family-oriented. Output is Disp&#8217;s big brother, Input is Prompt&#8217;s little brother, Else is If&#8217;s big broth&#8211;oh, we haven&#8217;t gotten there yet. Round three is coming.)</p>
<p>Prompt is <em>great</em> for math. Take the Pythagorean Theorem:</p>
<pre>Prompt A,B
A^2+B^2-&gt;D
sqrt(D)-&gt;C
Disp C

Which will display:

A=?
B=?
(The solution, which depends on the input)</pre>
<p>So Prompt is just a quick and easy way of getting a bunch of variables inputted. Would I use it for games, or polished programs? No. Do I use it for quickly making a program that&#8217;ll do a mathematical formula? Always.</p>
<p><!-- Beginning of Project Wonderful ad code: -->
<!-- Ad box ID: 34641 -->
<script type="text/javascript">
<!--
var d=document;
d.projectwonderful_adbox_id = "34641";
d.projectwonderful_adbox_type = "1";
d.projectwonderful_foreground_color = "";
d.projectwonderful_background_color = "";
//-->
</script>
<script type="text/javascript" src="http://www.projectwonderful.com/ad_display.js"></script>
<!-- End of Project Wonderful ad code. --></p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=Rannsaich%20mo%20Inntinn&amp;siteurl=http%3A%2F%2Fblog.tsmacdonald.com%2F&amp;linkname=TI-BASIC%20%28Round%20Two-and-a-Half%29%20%28More%20with%20Input%29&amp;linkurl=http%3A%2F%2Fblog.tsmacdonald.com%2Farchives%2F27" target="_blank"><img src="http://blog.tsmacdonald.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://blog.tsmacdonald.com/archives/27/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TI-BASIC (Round *) (Special Bonus Edition)</title>
		<link>http://blog.tsmacdonald.com/archives/25</link>
		<comments>http://blog.tsmacdonald.com/archives/25#comments</comments>
		<pubDate>Sat, 27 Sep 2008 16:45:13 +0000</pubDate>
		<dc:creator>Timmy</dc:creator>
				<category><![CDATA[Multi-part Series]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[BASIC]]></category>
		<category><![CDATA[calculator programming]]></category>
		<category><![CDATA[TI-BASIC]]></category>

		<guid isPermaLink="false">http://tmac.andrewmin.com/blog/?p=25</guid>
		<description><![CDATA[I&#8217;ve been thinking, and I realized it&#8217;d be nice to add another goal to the TI-BASIC series. So I&#8217;m adding a sample program. About the program: It&#8217;s called &#8216;Guess!&#8217; (I am really creative), and it&#8217;s been around since I was in the fifth grade, in one form or another. It consists of guessing a number [...]<p><!-- Beginning of Project Wonderful ad code: -->
<!-- Ad box ID: 34641 -->
<script type="text/javascript">
<!--
var d=document;
d.projectwonderful_adbox_id = "34641";
d.projectwonderful_adbox_type = "1";
d.projectwonderful_foreground_color = "";
d.projectwonderful_background_color = "";
//-->
</script>
<script type="text/javascript" src="http://www.projectwonderful.com/ad_display.js"></script>
<!-- End of Project Wonderful ad code. --></p>
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been thinking, and I realized it&#8217;d be nice to add another goal to the TI-BASIC series. So I&#8217;m adding a sample program.</p>
<p><strong>About the program</strong>: It&#8217;s called &#8216;Guess!&#8217; (I am <em>really</em> creative), and it&#8217;s been around since I was in the fifth grade, in one form or another. It consists of guessing a number from 1-100, and being told if it&#8217;s too big or too small, and then guessing again, and being told again, etcetera, until you guess the number.</p>
<p><strong>Technical description:</strong> Before you make a program, it&#8217;s a really really really really really really really <em>really</em> good idea to know <em>exactly</em> what you want it to do. So here&#8217;s the &#8216;outline&#8217; (remember that # and everything after it is a comment):</p>
<p>Guess! (GPL 2008 T. Macdonald) #Title and license (GPL is sort of like a Copyright)</p>
<p>Guess: #User guesses a number</p>
<p>Too big! #If the number&#8217;s too big</p>
<p>Too small! #If it&#8217;s too small</p>
<p>You win! #If the user guesses it</p>
<p>And that&#8217;s it. Believe it or not, the minute it took to write that saved a <em>lot</em> of wasted coding.</p>
<p>So let&#8217;s implement what we already know:</p>
<pre>Disp "Guess!","","(GPL) 2008", "T. Macdonald"</pre>
<pre>#Note that going from the outline to the implementation there was a better idea--putting 'Guess!' and the GPL on separate lines.
Input "Guess:".G
#Oh no! We don't know how to make a random number!
#Oh no! We don't know how to say if the number is too big or too small!
#(That's why the tutorial's not done. Stay tuned.)</pre>
<p><!-- Beginning of Project Wonderful ad code: -->
<!-- Ad box ID: 34641 -->
<script type="text/javascript">
<!--
var d=document;
d.projectwonderful_adbox_id = "34641";
d.projectwonderful_adbox_type = "1";
d.projectwonderful_foreground_color = "";
d.projectwonderful_background_color = "";
//-->
</script>
<script type="text/javascript" src="http://www.projectwonderful.com/ad_display.js"></script>
<!-- End of Project Wonderful ad code. --></p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=Rannsaich%20mo%20Inntinn&amp;siteurl=http%3A%2F%2Fblog.tsmacdonald.com%2F&amp;linkname=TI-BASIC%20%28Round%20%2A%29%20%28Special%20Bonus%20Edition%29&amp;linkurl=http%3A%2F%2Fblog.tsmacdonald.com%2Farchives%2F25" target="_blank"><img src="http://blog.tsmacdonald.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://blog.tsmacdonald.com/archives/25/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TI-BASIC (Round Two) (Basic BASIC Input&#8230;and Math)</title>
		<link>http://blog.tsmacdonald.com/archives/11</link>
		<comments>http://blog.tsmacdonald.com/archives/11#comments</comments>
		<pubDate>Tue, 23 Sep 2008 16:06:01 +0000</pubDate>
		<dc:creator>Timmy</dc:creator>
				<category><![CDATA[Multi-part Series]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[BASIC]]></category>
		<category><![CDATA[calculator programming]]></category>
		<category><![CDATA[Plus]]></category>
		<category><![CDATA[SE]]></category>
		<category><![CDATA[Silver Edition]]></category>
		<category><![CDATA[TI-83]]></category>
		<category><![CDATA[TI-84]]></category>
		<category><![CDATA[TI-86]]></category>
		<category><![CDATA[TI-BASIC]]></category>

		<guid isPermaLink="false">http://tmac.andrewmin.com/blog/?p=11</guid>
		<description><![CDATA[If you have a program that consists solely of displaying things, and it’s not some kind of thrilling narrative or story, then you have problems. What you need is input. So here’s how to do it: Input X Disp X Wasn’t that tricky? When you run it, you’ll get a question mark (as in, “Yo! [...]<p><!-- Beginning of Project Wonderful ad code: -->
<!-- Ad box ID: 34641 -->
<script type="text/javascript">
<!--
var d=document;
d.projectwonderful_adbox_id = "34641";
d.projectwonderful_adbox_type = "1";
d.projectwonderful_foreground_color = "";
d.projectwonderful_background_color = "";
//-->
</script>
<script type="text/javascript" src="http://www.projectwonderful.com/ad_display.js"></script>
<!-- End of Project Wonderful ad code. --></p>
]]></description>
			<content:encoded><![CDATA[<p>If you have a program that consists solely of displaying things, and it’s not some kind of thrilling narrative or story, then you have problems.<br />
What you need is input.<br />
So here’s how to do it:</p>
<pre>Input X
Disp X</pre>
<p>Wasn’t that tricky? When you run it, you’ll get a question mark (as in, “Yo! What do you want to input?”) and when you type something in (numbers only, for now), it’ll name the input ‘X’. Then you just ask it to display X.</p>
<p>(Input is in the same menu as Disp, if you’re having trouble finding it. Typing in I then N then P…etcetera, won’t work)</p>
<p>Now let’s do something (somewhat) useful:</p>
<pre>Input L #L for length</pre>
<pre>Input W #W for width</pre>
<pre>Disp L*W</pre>
<p>(NOTE: Everything after a # is a comment. <em>Do not type it into the actual program</em>, it’s just me explaining why I wrote a particular line the way it is. So what you should type in is:)</p>
<pre>Input L</pre>
<pre>Input W</pre>
<pre>Disp L*W</pre>
<p>There’ll be a ‘?’. You type in a number (length of rectangle). There’ll be another ‘?’. You type in another number (width of rectangle). It displays the product of the two numbers (area of rectangle).</p>
<p>In terms of <em>function</em> that ends our lesson on Input. However, I find the ‘?’s pretty ugly. Especially when you have several. So here’s the syntax for pretty-fying them.</p>
<pre>Input "Length:",L</pre>
<pre>Input "Width:",W</pre>
<pre>Disp "Area is:",L*W</pre>
<p>Here’s the output:</p>
<pre>Length:3</pre>
<pre>Width:2</pre>
<pre>Area is:</pre>
<pre>                6</pre>
<p>One more thing: the ‘Input’ function only accepts numbers. This can be lame if you want the person to, say, type in their name. (What’s your name? 1337)</p>
<p>The TI-86 has a different function called “InpSt” (Input String), which lets the user input a string of letters, not numbers. However, I’m pretty sure that the TI-83/84/80 families do not have this. Darn.</p>
<p>That’s all you need to know about Input to succeed in life <img src="../wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p>
<p>Now let’s talk about math. (Don’t worry, it’s a bit more interesting than normal math.) We’ve already touched on it, and the best way of explaining it is giving a sample program.</p>
<p>(Note: I’m going to use ‘-&gt;’ for the Store key throughout this entire guide. The Store key has Sto&gt; written on it (the &gt; is filled in though) and is used for assigning values to variables.)(I’ll also use sqrt() for the square root sign)</p>
<p>This program will solve for the hypotenuse of a right triangle.</p>
<pre>Input "A:",A
Input "B:",B
A^2 + B^2-&gt;D
Disp "C squared is:",D
sqrt(D)-&gt;C
Disp "Hypotenuse is:",C</pre>
<p>So the moral of the story (erm, program, I mean) is that you can do math with variables in programs.</p>
<p><!-- Beginning of Project Wonderful ad code: -->
<!-- Ad box ID: 34641 -->
<script type="text/javascript">
<!--
var d=document;
d.projectwonderful_adbox_id = "34641";
d.projectwonderful_adbox_type = "1";
d.projectwonderful_foreground_color = "";
d.projectwonderful_background_color = "";
//-->
</script>
<script type="text/javascript" src="http://www.projectwonderful.com/ad_display.js"></script>
<!-- End of Project Wonderful ad code. --></p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=Rannsaich%20mo%20Inntinn&amp;siteurl=http%3A%2F%2Fblog.tsmacdonald.com%2F&amp;linkname=TI-BASIC%20%28Round%20Two%29%20%28Basic%20BASIC%20Input%26%238230%3Band%20Math%29&amp;linkurl=http%3A%2F%2Fblog.tsmacdonald.com%2Farchives%2F11" target="_blank"><img src="http://blog.tsmacdonald.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://blog.tsmacdonald.com/archives/11/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TI-BASIC (Round One-and-a-Half) (Fun with Disp)</title>
		<link>http://blog.tsmacdonald.com/archives/9</link>
		<comments>http://blog.tsmacdonald.com/archives/9#comments</comments>
		<pubDate>Tue, 23 Sep 2008 16:04:02 +0000</pubDate>
		<dc:creator>Timmy</dc:creator>
				<category><![CDATA[Multi-part Series]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[BASIC]]></category>
		<category><![CDATA[calculator programming]]></category>
		<category><![CDATA[Plus]]></category>
		<category><![CDATA[SE]]></category>
		<category><![CDATA[Silver Edition]]></category>
		<category><![CDATA[TI-83]]></category>
		<category><![CDATA[TI-84]]></category>
		<category><![CDATA[TI-86]]></category>
		<category><![CDATA[TI-BASIC]]></category>

		<guid isPermaLink="false">http://tmac.andrewmin.com/blog/?p=9</guid>
		<description><![CDATA[We touched on the Disp command in Round One. I’ve since realized that in my quest for simplicity, I didn’t say very much about it. So here are a few things (Every other line is the Disp command, and the other lines are the output) Disp “2+2″ 2+2 Disp 2+2 4 Disp “2+2″,2+2 2+2 (aligned [...]<p><!-- Beginning of Project Wonderful ad code: -->
<!-- Ad box ID: 34641 -->
<script type="text/javascript">
<!--
var d=document;
d.projectwonderful_adbox_id = "34641";
d.projectwonderful_adbox_type = "1";
d.projectwonderful_foreground_color = "";
d.projectwonderful_background_color = "";
//-->
</script>
<script type="text/javascript" src="http://www.projectwonderful.com/ad_display.js"></script>
<!-- End of Project Wonderful ad code. --></p>
]]></description>
			<content:encoded><![CDATA[<table class="card" border="0">
<tbody class="card-tbody">
<tr>
<td class="cc c">
<div class="entry-container">
<div class="entry-main">
<div class="entry-body">
<div>
<div class="item-body">
<div>
<p>We touched on the Disp command in Round One. I’ve since realized that in my quest for simplicity, I didn’t say very much about it. So here are a few things (Every other line is the Disp command, and the other lines are the output)<br />
Disp “2+2″<br />
<strong>2+2</strong><br />
Disp 2+2<br />
<strong>4</strong><br />
Disp “2+2″,2+2<br />
<strong>2+2</strong> (aligned left) [new line] <strong>4 </strong>(aligned right)</p>
<p>Disp 2+2,2+2,2+2,3+2</p>
<p><strong>4</strong> [new line]<strong>4</strong> [new line]<strong>4</strong> [new line]<strong>5</strong> [new line]</p>
<p>Output(1,1,”Hello World!”)</p>
<p>(Note: This is not Disp. This is Disp’s big brother Output. Output let’s you ‘plot’ the output on the screen. So the ‘1,1′ means that it puts the output in the first column and the first row.</p>
<p><strong>Hello World!</strong></p>
<p>So now you should have a better handle on the syntax</p></div>
</div>
</div>
</div>
</div>
</div>
</td>
<td class="cr c"></td>
</tr>
<tr class="card-actionrow">
<td class="cal c"></td>
</tr>
</tbody>
</table>
<p><!-- Beginning of Project Wonderful ad code: -->
<!-- Ad box ID: 34641 -->
<script type="text/javascript">
<!--
var d=document;
d.projectwonderful_adbox_id = "34641";
d.projectwonderful_adbox_type = "1";
d.projectwonderful_foreground_color = "";
d.projectwonderful_background_color = "";
//-->
</script>
<script type="text/javascript" src="http://www.projectwonderful.com/ad_display.js"></script>
<!-- End of Project Wonderful ad code. --></p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=Rannsaich%20mo%20Inntinn&amp;siteurl=http%3A%2F%2Fblog.tsmacdonald.com%2F&amp;linkname=TI-BASIC%20%28Round%20One-and-a-Half%29%20%28Fun%20with%20Disp%29&amp;linkurl=http%3A%2F%2Fblog.tsmacdonald.com%2Farchives%2F9" target="_blank"><img src="http://blog.tsmacdonald.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://blog.tsmacdonald.com/archives/9/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TI-BASIC (Round One) (Getting Started, Disp)</title>
		<link>http://blog.tsmacdonald.com/archives/7</link>
		<comments>http://blog.tsmacdonald.com/archives/7#comments</comments>
		<pubDate>Tue, 23 Sep 2008 16:02:49 +0000</pubDate>
		<dc:creator>Timmy</dc:creator>
				<category><![CDATA[Multi-part Series]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[BASIC]]></category>
		<category><![CDATA[calculator programming]]></category>
		<category><![CDATA[Plus]]></category>
		<category><![CDATA[SE]]></category>
		<category><![CDATA[Silver Edition]]></category>
		<category><![CDATA[TI-83]]></category>
		<category><![CDATA[TI-84]]></category>
		<category><![CDATA[TI-86]]></category>
		<category><![CDATA[TI-BASIC]]></category>

		<guid isPermaLink="false">http://tmac.andrewmin.com/blog/?p=7</guid>
		<description><![CDATA[I’ve decided to make a tutorial/guide thing for TI-BASIC (that’s the programming language on Texas Instruments calculators) because….well, I want to. Hopefully people find it useful. Before we get started with the mechanics of TI-BASIC, it’s important to say a few general things about programming: 1. There’s four main things that happen in a program. [...]<p><!-- Beginning of Project Wonderful ad code: -->
<!-- Ad box ID: 34641 -->
<script type="text/javascript">
<!--
var d=document;
d.projectwonderful_adbox_id = "34641";
d.projectwonderful_adbox_type = "1";
d.projectwonderful_foreground_color = "";
d.projectwonderful_background_color = "";
//-->
</script>
<script type="text/javascript" src="http://www.projectwonderful.com/ad_display.js"></script>
<!-- End of Project Wonderful ad code. --></p>
]]></description>
			<content:encoded><![CDATA[<table class="card" style="height: 668px;" border="0" width="726">
<tbody class="card-tbody">
<tr>
<td class="cc c">
<div class="entry-container">
<div class="entry-main">
<div class="entry-body">
<div>
<div class="item-body">
<div>
<p>I’ve decided to make a tutorial/guide thing for TI-BASIC (that’s the programming language on Texas Instruments calculators) because….well, I want to. Hopefully people find it useful.<br />
Before we get started with the mechanics of TI-BASIC, it’s important to say a few general things about programming:</p>
<p>1. There’s four main things that happen in a program. Input is what the user puts in. Output is what the calculator spits back out.<br />
Control flow is what the programmer uses to adjust the ‘flow’ of a program (programs are ‘read’ from top to bottom, so you need to specifically state when it shouldn’t be), and finally ‘operations’ (I just made <em>that</em> term up) that let you modify the input and output.<br />
2. It’s very important to know what you want a program to do before you make it. It’s no good to say “I want it do check my answers for math class”. You need to say “I want it to ask me for two numbers, add the two numbers together, and then display the result.”<br />
3. Thinking is required. All of it doesn’t just come naturally, sometimes you need to sit down and think out what the best way of doing something is.</p>
<p>So, that said, let’s start with–well, how to make and run a program on your calculator.<br />
Turn your calculator on (a lot of this <em>is</em> easy.) And press the <span style="font-family: courier new;">PRGM</span> on it. If you have a TI-86/85, press F2 (Edit), and type in a new name for your program. If you’re using a TI-80/81/82/83/83+/83+SE/84+/84+SE, scroll over to the “Create New” tab, and type in a new name. (Note: I didn’t include TI-89s in the list because I don’t have one. If you send me one, I’d be more than happy to include it in this guide <img src="../wp-includes/images/smilies/icon_smile.gif" alt=":)" /> After you type in the name, and press <span style="font-family: courier new;">ENTER</span>, you’ll see a screen that says<br />
<span style="font-family: courier new;">PROGRAM:A NAME<br />
:</span></p>
<p>Where <span style="font-family: courier new;">A NAME</span> is the name you typed in.</p>
<p>Pressing <span style="font-family: courier new;">QUIT<span> will exit the Programming screen, save the program, and return you to the home screen all in one.</span></span></p>
<p>So now that that’s taken care of, let’s write a simple program. There’s a tradition among programmers to always use “Hello World!” as a first program. So<br />
open up a new program and call it <span style="font-family: courier new;">HELLO</span>. Now let’s take a moment and think about this. You want the program to say “Hello World!” when it’s run. That’s output. There’s no input necessary. You don’t need to control the flow, because the calculator doesn’t need to react differently to anything, and finally, since there’s no input, no operations need to take place.</p>
<p>So press the <span style="font-family: courier new;">PRGM</span> button again. You should see a menu labelled <span style="font-family: courier new;">Ctl</span>, that has stuff like <span style="font-family: courier new;">If, While, For, End</span>, etc. Scroll over one, to the <span style="font-family: courier new;">I/O</span> menu, and select the <span style="font-family: courier new;">Disp</span> option. <span style="font-family: courier new;">Disp</span> stands for “Display”, and is the command to display something on the screen. After the <span style="font-family: courier new;">Disp</span>, type in: <span style="font-family: courier new;">“Hello World!”</span>. Now your calculator knows to display something, and it knows the thing to display is ‘Hello World!’.</p>
<p><span style="font-family: courier new;"><br />
PRGM: HELLO <img src='http://blog.tsmacdonald.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> isp “HELLO WORLD!”<br />
</span></p>
<p>Run the program by quitting, hitting <span style="font-family: courier new;">PRGM</span>, and selecting ‘HELLO’. This’ll paste something onto your home screen. Press <span style="font-family: courier new;">ENTER</span> to run the program.</p>
<p><span style="font-family: courier new;"><br />
prgm_HELLO<br />
HELLO WORLD!<br />
Done</span></p>
<p>Round two: Basic BASIC input and math.</p></div>
</div>
</div>
</div>
</div>
</div>
</td>
<td class="cr c"></td>
</tr>
<tr class="card-actionrow">
<td class="cal c"></td>
<td class="ca c"></td>
<td class="car c"></td>
</tr>
<tr class="card-bottomrow">
<td class="cbl c"></td>
<td class="cb c"></td>
<td class="cbr c"></td>
</tr>
</tbody>
</table>
<table class="card" border="0">
<tbody class="card-tbody">
<tr>
<td class="ctl c"></td>
</tr>
</tbody>
</table>
<p><!-- Beginning of Project Wonderful ad code: -->
<!-- Ad box ID: 34641 -->
<script type="text/javascript">
<!--
var d=document;
d.projectwonderful_adbox_id = "34641";
d.projectwonderful_adbox_type = "1";
d.projectwonderful_foreground_color = "";
d.projectwonderful_background_color = "";
//-->
</script>
<script type="text/javascript" src="http://www.projectwonderful.com/ad_display.js"></script>
<!-- End of Project Wonderful ad code. --></p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=Rannsaich%20mo%20Inntinn&amp;siteurl=http%3A%2F%2Fblog.tsmacdonald.com%2F&amp;linkname=TI-BASIC%20%28Round%20One%29%20%28Getting%20Started%2C%20Disp%29&amp;linkurl=http%3A%2F%2Fblog.tsmacdonald.com%2Farchives%2F7" target="_blank"><img src="http://blog.tsmacdonald.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://blog.tsmacdonald.com/archives/7/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

