I’ve gotta be better with these updates. It’s been about 10 months since my last post.
Work on the new phones is slow to non-existant, 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 six months. 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’t get at it. It was a simple fix, but I just took forever to get around to it.
Second, the software fix I mentioned last time works great. It basically allows each module (game) to have its own vocabulary. That means that if I have a game/module with a large vocabulary (like Zork with its nearly 700 words), it doesn’t negatively impact the recognition performance of modules with limited vocabulary (like Animal, which uses only about 5 words.) It means I can leave Zork enabled and add lots of other games without having them conflict with each other.
To that end I’ve been trying to find classic computer games that only require text input/output and have relatively limited vocabularies. I’ve got 3 so far. The first was actually implemented at last year’s Maker Faire: Animal. (It wasn’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. The neat thing about the original is that if you stump it, it can add a question and learn that animal. The learning part hasn’t been implemented in the phone version, but a command-line variant allows me to populate the database. It currently knows 122 different animals, but some of the questions are less than ideal. (Does a cat have stripes? Some do, some don’t, but ‘sometimes’ isn’t a valid answer to this program, so I chose “yes”) I actually didn’t refer to the BASIC source when coding this up, so there are some minor differences.
Recently I’ve added two more: Blackjack and Hammurabi.
Blackjack isn’t yet as full featured as the original basic program. Right now it only allows you to hit or stand, and doesn’t allow for betting, splitting or doubling down, but I’ll get there.
Hammurabi allows you to rule Babylon like the real Hammurabi (sorta). You try to feed your people, grow more grain, and manage your land over 10 years. Starve too many or sell too much land and they’ll revolt. I based the game play on several different versions I found online, but it’s fairly faithful in how it follows the rules (that were consistent across different implementations anyway). The phone based game makes a few concessions to the limitations of the interface. First, you only rule for 5 years rather than the original 10, because talking through a 10 year reign was just tedious. 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. The biggest technical hurdle for this game was parsing numbers spoken out loud. My first pass at a parser is basically stolen from stackoverflow, but it has some limitations/bugs, and there appear to be better implementations. This is especially annoying when you try to say ‘fifty five’, but the STT engine hears ‘fifteen five’ which parses to twenty. Similarly if you say 270 as ‘two seventy’ you get 72 instead. The TTS engine also has some quirks that are making this challenging. It reads 1040 as “ten forty”, and more confusingly it reads 1800 as merely “eighteen”, missing the hundred entirely. I’m guessing this is partly due to the way people typically say years (1986 is “nineteen eighty six” after all, seldom do people say “one thousand nine hundred and eighty six”.)
You can check out the code in the gitbub fork I have of the jasper project. It’s not all pretty or elegant, but it’s at least mostly functional.