Skip to content

Instantly share code, notes, and snippets.

@deadprogram
Created January 27, 2011 02:57
Show Gist options
  • Save deadprogram/797983 to your computer and use it in GitHub Desktop.
Save deadprogram/797983 to your computer and use it in GitHub Desktop.
<div class="lesson"><span>Lists of Instructions</span>
<div><span>A to-do list, not a shopping list</span>
<p>When I say that computers follow lists of instructions, I mean a to-do list, not a shopping list. What I'm trying to say is that these lists have an <strong>order</strong> to them that the computer follows. It does each step in turn as quickly as it possibly can.</p>
<p>A shopping list is a different kind of list entirely. You can go to whichever aisle you choose, and as long as you get everything before you leave, you're A-OK. This isn't what the computer does at all.</p>
</div>
<div><span>How would you tell a person to do it?</span>
<p>Let's try an example: if you had to tell someone in words how to draw a square on a piece of paper, how would you do it?</p>
<p>You're not allowed to say "like this" or "this way," that's cheating! You have to spell out every detail.</p>
</div>
<div><span>Once again: computers are simple</span>
<p>How'd you do? I can't see what you said, but here's an example of how simple computers are compared to people. Did you forget to mention how long each side of the square is? If you didn't good job!</p>
<p>Here's how I'd do it, by the way. This isn't the only right answer, it's just an example:</p>
<p>1. Put your pen down on the paper.</p>
<p>2. Draw right one inch.</p>
<p>3. Draw down one inch.</p>
<p>4. Draw left one inch.</p>
<p>5. Draw up one inch.</p>
<p>6. Take your pen off of the paper.</p>
<p>7. You're done!</p>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment