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-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 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.
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.