{"id":140,"date":"2018-04-13T23:56:19","date_gmt":"2018-04-13T23:56:19","guid":{"rendered":"http:\/\/dial-a-grue.com\/gory\/?p=140"},"modified":"2019-02-26T19:07:42","modified_gmt":"2019-02-26T19:07:42","slug":"new-games","status":"publish","type":"post","link":"https:\/\/dial-a-grue.com\/gory\/?p=140","title":{"rendered":"New games"},"content":{"rendered":"<p>I&#8217;ve gotta be better with these updates.\u00c2\u00a0 It&#8217;s been about 10 months since my last post.<\/p>\n<p>Work on the new phones is slow to non-existent, but I finally spent some time getting the old phone in better shape, both hardware and software.<\/p>\n<p>First, the phone is now back in one piece after sitting disassembled for six months.\u00c2\u00a0 I took it apart to reflash the C.H.I.P. comptuer since it was having filesystem errors, and in the process broke off one of the wires for the on-hook switch inside the wiring block where I couldn&#8217;t get at it. It was a simple fix, but I just took forever to get around to it.<\/p>\n<p>Second, the software fix I mentioned <a href=\"https:\/\/dial-a-grue.com\/gory\/?p=137\">last time<\/a> works great.\u00c2\u00a0 It basically allows each module (game) to have its own vocabulary.\u00c2\u00a0 That means that if I have a game\/module with a large vocabulary (like Zork with its nearly 700 words), it doesn&#8217;t negatively impact the recognition performance of modules with limited vocabulary (like Animal, which uses only about 5 words.)\u00c2\u00a0 It means I can leave Zork enabled and add lots of other games without having them conflict with each other.<\/p>\n<p>To that end I&#8217;ve been trying to find classic computer games that only require text input\/output and have relatively limited vocabularies.\u00c2\u00a0 I&#8217;ve got 3 so far.\u00c2\u00a0 The first was actually implemented at last year&#8217;s Maker Faire: <a href=\"https:\/\/www.atariarchives.org\/basicgames\/showpage.php?page=4\">Animal<\/a>. (It wasn&#8217;t demoed because the computer died before it was complete.) Animal plays simple guessing game where it asks you to think of an animal and asks you yes-or-no questions about it.\u00c2\u00a0 The neat thing about the original is that if you stump it, it can add a question and learn that animal.\u00c2\u00a0 The learning part hasn&#8217;t been implemented in the phone version, but a command-line variant allows me to populate the database.\u00c2\u00a0 It currently knows 122 different animals, but some of the questions are less than ideal.\u00c2\u00a0 (Does a cat have stripes?\u00c2\u00a0 Some do, some don&#8217;t, but &#8216;sometimes&#8217; isn&#8217;t a valid answer to this program, so I chose &#8220;yes&#8221;)\u00c2\u00a0 I actually didn&#8217;t refer to the BASIC source when coding this up, so there are some minor differences.<\/p>\n<p>Recently I&#8217;ve added two more: <a href=\"https:\/\/www.atariarchives.org\/basicgames\/showpage.php?page=18\">Blackjack<\/a> and <a href=\"https:\/\/www.atariarchives.org\/basicgames\/showpage.php?page=78\">Hammurabi<\/a>.<\/p>\n<p>Blackjack isn&#8217;t yet as full featured as the original basic program.\u00c2\u00a0 \u00c2\u00a0Right now it only allows you to hit or stand, and doesn&#8217;t allow for betting, splitting or doubling down, but I&#8217;ll get there.<\/p>\n<p>Hammurabi allows you to rule Babylon like the real Hammurabi (sorta).\u00c2\u00a0 You try to feed your people, grow more grain, and manage your land over 10 years.\u00c2\u00a0 Starve too many or sell too much land and they&#8217;ll revolt.\u00c2\u00a0 I based the game play on several different versions I found online, but it&#8217;s fairly faithful in how it follows the rules (that were consistent across different implementations anyway).\u00c2\u00a0 The phone based game makes a few concessions to the limitations of the interface.\u00c2\u00a0 First, you only rule for 5 years rather than the original 10, because talking through a 10 year reign was just tedious.\u00c2\u00a0 Second, it removes the need to do quite as much mental math-for instance, by allowing you to specify how many people you want to feed rather than how many bushels of wheat you want to feed them, and also suggests quasi-optimal plays.\u00c2\u00a0 The biggest technical hurdle for this game was parsing numbers spoken out loud.\u00c2\u00a0 My first pass at a parser is basically <a href=\"https:\/\/stackoverflow.com\/questions\/493174\/is-there-a-way-to-convert-number-words-to-integers\">stolen from stackoverflow,<\/a> but it has some limitations\/bugs, and there appear to be better implementations.\u00c2\u00a0 This is especially annoying when you try to say &#8216;fifty five&#8217;, but the STT engine hears &#8216;fifteen five&#8217; which parses to twenty.\u00c2\u00a0 Similarly if you say 270 as &#8216;two seventy&#8217; you get 72 instead.\u00c2\u00a0 The TTS engine also has some quirks that are making this challenging.\u00c2\u00a0 It reads 1040 as &#8220;ten forty&#8221;, and more confusingly it reads 1800 as merely &#8220;eighteen&#8221;, missing the hundred entirely.\u00c2\u00a0 I&#8217;m guessing this is partly due to the way people typically say years (1986 is &#8220;nineteen eighty six&#8221; after all, seldom do people say &#8220;one thousand nine hundred and eighty six&#8221;.)<\/p>\n<p>You can check out the code in the <a href=\"https:\/\/github.com\/pneumaticdeath\/dial-a-grue\">gitbub fork<\/a> I have of the jasper project.\u00c2\u00a0 It&#8217;s not all pretty or elegant, but it&#8217;s at least mostly functional.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve gotta be better with these updates.\u00c2\u00a0 It&#8217;s been about 10 months since my last post. Work on the new phones is slow to non-existent, but I finally spent some time getting the old phone in better shape, both hardware and software. First, the phone is now back in one piece after sitting disassembled for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,9,7,8],"tags":[],"class_list":["post-140","post","type-post","status-publish","format-standard","hentry","category-brains","category-coding","category-phone","category-wetwork"],"_links":{"self":[{"href":"https:\/\/dial-a-grue.com\/gory\/index.php?rest_route=\/wp\/v2\/posts\/140","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dial-a-grue.com\/gory\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dial-a-grue.com\/gory\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dial-a-grue.com\/gory\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dial-a-grue.com\/gory\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=140"}],"version-history":[{"count":0,"href":"https:\/\/dial-a-grue.com\/gory\/index.php?rest_route=\/wp\/v2\/posts\/140\/revisions"}],"wp:attachment":[{"href":"https:\/\/dial-a-grue.com\/gory\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dial-a-grue.com\/gory\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dial-a-grue.com\/gory\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}