{"id":23,"date":"2011-10-23T00:56:22","date_gmt":"2011-10-23T00:56:22","guid":{"rendered":"http:\/\/minkhollow.ca\/books\/?page_id=23"},"modified":"2014-07-21T18:59:23","modified_gmt":"2014-07-21T18:59:23","slug":"4-2","status":"publish","type":"page","link":"http:\/\/minkhollow.ca\/books\/?page_id=23","title":{"rendered":"4: How Programs Work"},"content":{"rendered":"<h1 id=\"Chapter_4\" >Chapter 4<\/h1>\n<p>Here&#8217;s were we will put color versions of the images, updates, and other extras.<\/p>\n<p>If you \u201clook under the hood\u201d of a computer simulation or game you will find that what drives the application is a set of computer programs. It is not necessary to understand any specific programming language or even to have ever written a program. Nonetheless in order to understand how simulations work, you need to understand how the algorithms that drive them work &#8211; at least well enough to be able to talk about what they are doing and how they are doing it. In order to do that you need a vocabulary for talking about algorithms. This chapter provides that vocabulary in the form of flowcharts which will be used throughout the remainder of the book to describe and outline the simulations and games you will develop.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-518\" src=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/wordl-sim-book-ch-4.png\" alt=\"wordl-sim-book-ch-4\" width=\"812\" height=\"525\" srcset=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/wordl-sim-book-ch-4.png 812w, http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/wordl-sim-book-ch-4-300x194.png 300w, http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/wordl-sim-book-ch-4-768x497.png 768w\" sizes=\"auto, (max-width: 812px) 100vw, 812px\" \/><\/p>\n<ol>\n<li>\n<div>Algorithms<\/div>\n<\/li>\n<li>\n<div>Example 1: A Bad Algorithm and Basic Flowcharts<\/div>\n<\/li>\n<li>\n<div>Example 2: Navigating an Automated Telephone Answering System: Decisions, Input, and Output<\/div>\n<\/li>\n<li>\n<div>Re-Cap<\/div>\n<\/li>\n<li>\n<div>Example 3: Mowing The Lawn: Modules<\/div>\n<\/li>\n<li>\n<div>Example 4: Making an Egg Salad: Iteration, Complexity, and Parameters<\/div>\n<\/li>\n<li>\n<div>Summary<\/div>\n<ol>\n<li>\n<div>Concepts<\/div>\n<\/li>\n<li>\n<div>Terminology<\/div>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<div>References, Notes &amp; Further Resources<\/div>\n<\/li>\n<\/ol>\n<h2 id=\"Images\" >Images<\/h2>\n<p>*Please note: all images are copyrighted, permission to use an image must be obtained from <a title=\"Wiley Copyright\" href=\"http:\/\/ca.wiley.com\/WileyCDA\/Section\/id-302345.html\" target=\"_blank\">Wiley<\/a> (and possibly also the original sources).<\/p>\n<figure id=\"attachment_191\" aria-describedby=\"caption-attachment-191\" style=\"width: 124px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch04f001.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-191\" title=\"Figure 4-1: Flowchart Symbols\" src=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch04f001.gif\" alt=\"\" width=\"124\" height=\"134\" \/><\/a><figcaption id=\"caption-attachment-191\" class=\"wp-caption-text\">Figure 4-1: Flowchart Symbols<\/figcaption><\/figure>\n<figure id=\"attachment_192\" aria-describedby=\"caption-attachment-192\" style=\"width: 212px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch04f002.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-192\" title=\"Figure 4-2: Algorithm for Washing Hair\" src=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch04f002.gif\" alt=\"\" width=\"212\" height=\"299\" \/><\/a><figcaption id=\"caption-attachment-192\" class=\"wp-caption-text\">Figure 4-2: Algorithm for Washing Hair<\/figcaption><\/figure>\n<figure id=\"attachment_193\" aria-describedby=\"caption-attachment-193\" style=\"width: 264px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch04f003.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-193\" title=\"Figure 4-3: Algorithm For Washing Hair, Version 2\" src=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch04f003-264x300.gif\" alt=\"\" width=\"264\" height=\"300\" \/><\/a><figcaption id=\"caption-attachment-193\" class=\"wp-caption-text\">Figure 4-3: Algorithm For Washing Hair, Version 2<\/figcaption><\/figure>\n<figure id=\"attachment_194\" aria-describedby=\"caption-attachment-194\" style=\"width: 146px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch04f004.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-194\" title=\"Figure 4-4: Flowchart Symbols, Version 2\" src=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch04f004.gif\" alt=\"\" width=\"146\" height=\"246\" \/><\/a><figcaption id=\"caption-attachment-194\" class=\"wp-caption-text\">Figure 4-4: Flowchart Symbols, Version 2<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_195\" aria-describedby=\"caption-attachment-195\" style=\"width: 239px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch04f005.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-195\" title=\"Figure 4-5: Automated Telephone Answering System\" src=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch04f005-239x300.gif\" alt=\"\" width=\"239\" height=\"300\" \/><\/a><figcaption id=\"caption-attachment-195\" class=\"wp-caption-text\">Figure 4-5: Automated Telephone Answering System<\/figcaption><\/figure>\n<figure id=\"attachment_196\" aria-describedby=\"caption-attachment-196\" style=\"width: 238px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch04f006.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-196\" title=\"Figure 4-6: Mowing the Lawn, Version 1\" src=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch04f006-238x300.gif\" alt=\"\" width=\"238\" height=\"300\" \/><\/a><figcaption id=\"caption-attachment-196\" class=\"wp-caption-text\">Figure 4-6: Mowing the Lawn, Version 1<\/figcaption><\/figure>\n<figure id=\"attachment_197\" aria-describedby=\"caption-attachment-197\" style=\"width: 235px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch04f007.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-197\" title=\"Figure 4-7: Flowchart Symbols, Version 3\" src=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch04f007-235x300.gif\" alt=\"\" width=\"235\" height=\"300\" \/><\/a><figcaption id=\"caption-attachment-197\" class=\"wp-caption-text\">Figure 4-7: Flowchart Symbols, Version 3<\/figcaption><\/figure>\n<figure id=\"attachment_198\" aria-describedby=\"caption-attachment-198\" style=\"width: 287px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch04f008.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-198\" title=\"Figure 4-8: Module: Do One Row\" src=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch04f008-287x300.gif\" alt=\"\" width=\"287\" height=\"300\" \/><\/a><figcaption id=\"caption-attachment-198\" class=\"wp-caption-text\">Figure 4-8: Module: Do One Row<\/figcaption><\/figure>\n<figure id=\"attachment_199\" aria-describedby=\"caption-attachment-199\" style=\"width: 231px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch04f009.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-199\" title=\"Figure 4-9: Mowing the Lawn, Version 2\" src=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch04f009-231x300.gif\" alt=\"\" width=\"231\" height=\"300\" \/><\/a><figcaption id=\"caption-attachment-199\" class=\"wp-caption-text\">Figure 4-9: Mowing the Lawn, Version 2<\/figcaption><\/figure>\n<figure id=\"attachment_200\" aria-describedby=\"caption-attachment-200\" style=\"width: 270px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch04f010.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-200\" title=\"Figure 4-10: Module Make &lt;N&gt; Eggs\" src=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch04f010-270x300.gif\" alt=\"\" width=\"270\" height=\"300\" \/><\/a><figcaption id=\"caption-attachment-200\" class=\"wp-caption-text\">Figure 4-10: Module Make &lt;N&gt; Eggs<\/figcaption><\/figure>\n<figure id=\"attachment_201\" aria-describedby=\"caption-attachment-201\" style=\"width: 172px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch04f011.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-201\" title=\"Figure 4-11: Algorithm: Make Egg Salad\" src=\"http:\/\/minkhollow.ca\/books\/wp-content\/uploads\/2011\/10\/ch04f011-172x300.gif\" alt=\"\" width=\"172\" height=\"300\" \/><\/a><figcaption id=\"caption-attachment-201\" class=\"wp-caption-text\">Figure 4-11: Algorithm: Make Egg Salad<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Chapter 4 Here&#8217;s were we will put color versions of the images, updates, and other extras. If you \u201clook under the hood\u201d of a computer simulation or game you will find that what drives the application is a set of computer programs. It is not necessary to understand any specific programming language or even to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":82,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","jetpack_post_was_ever_published":false,"footnotes":""},"class_list":{"0":"post-23","1":"page","2":"type-page","3":"status-publish","4":"has-post-thumbnail","6":"entry"},"jetpack_shortlink":"https:\/\/wp.me\/P4QGQz-n","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/minkhollow.ca\/books\/index.php?rest_route=\/wp\/v2\/pages\/23","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/minkhollow.ca\/books\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/minkhollow.ca\/books\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/minkhollow.ca\/books\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/minkhollow.ca\/books\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=23"}],"version-history":[{"count":8,"href":"http:\/\/minkhollow.ca\/books\/index.php?rest_route=\/wp\/v2\/pages\/23\/revisions"}],"predecessor-version":[{"id":520,"href":"http:\/\/minkhollow.ca\/books\/index.php?rest_route=\/wp\/v2\/pages\/23\/revisions\/520"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/minkhollow.ca\/books\/index.php?rest_route=\/wp\/v2\/media\/82"}],"wp:attachment":[{"href":"http:\/\/minkhollow.ca\/books\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}