{"id":1224,"date":"2010-02-28T20:53:05","date_gmt":"2010-03-01T04:53:05","guid":{"rendered":"https:\/\/mathpirate.net\/log\/?p=1224"},"modified":"2010-02-28T20:53:05","modified_gmt":"2010-03-01T04:53:05","slug":"finite-state-machine","status":"publish","type":"post","link":"https:\/\/mathpirate.net\/log\/2010\/02\/28\/finite-state-machine\/","title":{"rendered":"Finite State Machine"},"content":{"rendered":"<p>I think I&#8217;m going to have to put together a finite state machine for the robot.\u00c2\u00a0 The robot for Pong had essentially two states:\u00c2\u00a0 &#8220;Playing&#8221; and &#8220;Totally Flipping Out&#8221;.\u00c2\u00a0 I need to do a better job than that for this one.<\/p>\n<p>Here&#8217;s the basic states for Kaboom!:<\/p>\n<ul>\n<li>Bombs on screen:\u00c2\u00a0 Track the lowest bomb.<\/li>\n<li>No Bombs on Screen: Press button.<\/li>\n<li>No Buckets on Screen:\u00c2\u00a0 Hit Game Reset switch.<\/li>\n<\/ul>\n<p>At this time, it won&#8217;t be able to hit the Game Reset switch itself, so it should probably put a notice on the screen for human intervention.\u00c2\u00a0 ((And I don&#8217;t want to give it the ability to hit the reset switch itself.\u00c2\u00a0 You teach it how to do that and you never know what it&#8217;s capable of.))\u00c2\u00a0 For the &#8220;No Bombs on Screen&#8221; state, it&#8217;s going to have to hit the button, then wait before trying to hit the button again, otherwise it&#8217;ll hit the button a second time, before the bombs start to fall, and it&#8217;ll lose precious reaction time.\u00c2\u00a0 When the bombs are on the screen, it&#8217;s going to have to be careful and make sure that it doesn&#8217;t get fooled by blips where the lowest bomb disappears for a frame.\u00c2\u00a0 However, it can&#8217;t be too careful, since it&#8217;s going to have to move to the next spot as soon as it catches a bomb.<\/p>\n<p>For now, I&#8217;ll get the &#8220;Bombs on Screen&#8221; state going, since that&#8217;s the one that&#8217;s important.\u00c2\u00a0 I can hit the button myself for now, as long as I&#8217;m careful to keep my fingers clear of the spinning bricks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I think I&#8217;m going to have to put together a finite state machine for the robot.\u00c2\u00a0 The robot for Pong had essentially two states:\u00c2\u00a0 &#8220;Playing&#8221; and &#8220;Totally Flipping Out&#8221;.\u00c2\u00a0 I need to do a better job than that for this one. Here&#8217;s the basic states for Kaboom!: Bombs on screen:\u00c2\u00a0 Track the lowest bomb. No [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[125],"tags":[17,15,16,77,20,28],"_links":{"self":[{"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/posts\/1224"}],"collection":[{"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/comments?post=1224"}],"version-history":[{"count":2,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/posts\/1224\/revisions"}],"predecessor-version":[{"id":1226,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/posts\/1224\/revisions\/1226"}],"wp:attachment":[{"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/media?parent=1224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/categories?post=1224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mathpirate.net\/log\/wp-json\/wp\/v2\/tags?post=1224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}