Sunday, March 27, 2016

The Sillifier

Ah, 90s background images.
The Moby Project has seen no activity in 16 years, but still has some really neat data.  It has a collection of word lists, including first and second edition Scrabble words, names, places, compound words, etc..  But it also has part-of-speech and pronunciation data for lots of words.  This is probably not what Siri uses to figure out what you said, but it's free and good for certain little toy projects, like a perl script to help find rhymes.

I decided to use the part-of-speech data to write a program that approximates my special sense of humor by replacing random words with other ones.  The idea is pretty simple - for each word, look up what kind of word it is, then replace that word with another one of the same kind - but there were some little hurdles to jump along the way.

A noun
The Moby data says,
potato N
Which means "potato" is a noun.  No surprise there.  But,
light NAVvi
Which means "light" is mostly a noun but also an adjective, a verb, and an adverb.  And without parsing the whole sentence my program wasn't able to tell which.  I didn't want full natural language parsing, we'll save that for another project.  Instead I went with a trick: find another word that can also be all of those things.

Oh, but "light" is the only NAVvi word in the set.  It wouldn't be very interesting to replace it with itself.  Moby sorts the parts-of-speech by likelihood, so I'll trim off the least likely usage and try again.  "Square" is marked as "NAVv", so except for the intransitive verb usage, it might fit.  One more step, to "NAV" gives 22 more choices, for instance "signal".  I might get even more choices if I considered "NAV" words equivalent to, for instance, "AVN", but I haven't tried that yet.

For some words, replacing them with another word really tends to make the sentence strange.  For instance, "had" and "been" are both marked "V", but when they appear together they take on particular meaning, and it no longer works to replace one of them with "sparge", say.  So I set up a list of words that the program leaves unaltered.

More potatoes. Random.
The Moby parts-of-speech list has around 230,000 entries, but I wanted to embed this list in a web page and keep the footprint as small as possible.  Besides, it can probably get away without knowing "tonsilitic" or "hoiden" or "abcoulomb".  This is a somewhat common problem with word lists, in my opinion: the top N lists are too short and all the rest are too long.   Somewhere there must be a middle ground in between the "1,000 most frequently used English words" and "first edition of the Official Scrabble Players Dictionary(tm)", but I can't seem to find such a list.  For this project I dropped everything that wasn't in the Scrabble list.

Finally, for many words, not all variations of the word were in the data.  So my program had to detect the "-ing" forms of verbs, for instance, replace just the base part, and put the "ing" back on the end afterward.  It's not very good at that (it thinks the past tense of "choose" is "chooseed"), but it's good enough to play with.

The end result is the page linked below.  There are some sample texts you can choose to get started, or enter your own text, and play with the sliders to see what kind of silliness it produces.  Or put another way, steer with the phenomenons to stand what conic of fact it dies.

Thursday, March 24, 2016

Walk Across Some Dungeons

I wrote some puzzles for the 2014 MIT Mystery Hunt.  One of them, Walk Across Some Dungeons, is a dungeon crawler with a character-based interface.

More confusing than it looks.

You don't fight in this game, you just walk to the end of each level.  Being made for the Mystery Hunt, I think this game is harder on the player than most.  You have to figure it out as you go, and one wrong move can send you back to the beginning of the level.  If you're going to give it a shot, try not to look at the solution page.  At least not unless you get really frustrated.

For the hunt, it was run on multiple servers as a python application with a web interface.  After the hunt ended I ported it to JavaScript so it can run in your browser.  The code quality isn't great, but with a little motivation and moxie you could fetch the sources and make your own levels by just changing maps.js
 (minor spoilers).

Thursday, March 17, 2016

I Went to the Gartner BI Summit and the Carpet Was Amazing

I attended the Gartner Business Intelligence & Analytics Summit at the Gaylord Texan Resort in Grapevine, Texas, and let me tell you they really know how to make a convention center carpet there.  The convention itself was great and all, lots of discussion about business intelligence and whatnot, but the carpet was just spectacular.

I saw people give presentations about data analytics, and explored the demos of various analysis products on the showroom floor.  Afterward I wandered over to flickr to scroll past several dozen pictures of the carpets of other convention centers, but honestly none of them hold a candle to this masterpiece.

People lined up to have poetry written on demand by Jacqueline Suskin.  I'm not sure if anyone asked for poetry about the carpet, but then again would poetry have done the carpet justice?  I'm not sure.

During one presentation, an analyst described how Coca-Cola uses chemical analysis and weather data to optimize the composition of Minute-Maid orange juice, ensuring flavor consistency even in the face of supply disruption.  I walked across the glorious carpet both to and from that presentation.

At the first keynote two pieces were played on a grand piano, to make a point about how some computer programs can do things we previously thought were reserved for humans.  One was by Johann Sebastian Bach, and one by a program called Kulitta.  I was unable to appreciate either, having earlier in the day seen the carpet.

On the flight home, my plane was decommissioned after we boarded.  We were deplaned and sent to another gate to board another plane, which ultimately landed an hour after I was intending to arrive.  Driving home, passing interstate construction and the steady pulse of street lamps, my mind returned to the carpet, its tangled Texan iconography following me home, an infinite repeating mosaic.


Sunday, March 6, 2016

The Robot Quest Soundtrack

I've uploaded the music from Robot Quest to SoundCloud, so if you're not inclined to install any Chrome apps, but still interested in my rudimentary MIDI handiwork, you can have a listen or a download with only a few clicks.

There are three tracks from the game:

  • Processing: The clock cycle of a simple-minded, trudging, oblivious robot.  Another part came in and seemed to me to be another robot - a companion - which decided for some reason to walk alongside the first.  This was my first and I think it's a little overcooked.
  • Robot Party: A more boisterous call-and-response-style piece, with more improvisation than you could reasonably expect from a room full of soulless machines.
  • Clockwork: I wanted something with guitars (well, "guitars").  I have partial lyrics for this one but I won't tell.  To sum it up: an undying machine, in love with a person, is confused and disappointed by mortality.  You probably wouldn't pick that up just from listening to it.
Plus a bonus track:
  • Plugged In:  Just piano and drums this time, with some fancy-fingers action.  I haven't found any robot symbolism in this one.  This isn't in the game because I haven't finished the fourth level.

Saturday, March 5, 2016

Hello, Robot Quest

A few years ago I started working on a game for my kids.  It's called Robot Quest, and it's about a robot that basically walks around talking to various characters, picking up items, slipping on ice, and so on.  It's not challenging, but it helped to introduce the kids to moving around with the arrow keys and they thought it was funny for a while.  I stopped working on it for a bit, but I thought I should release what I have in case someone else might enjoy it.

The farmer has a problem with his pig.

The music is basic MIDI made with Anvil Studio and Audacity, and the graphics with Inkscape.  It's written in HTML/JavaScript/CSS, and released as a Chome Web Store app, so you can install it directly into Chrome.  For my kids, I set it up on a Chromebook.

Here's the store link again:

Robot Quest (Store)

Here's a link to a web version.  It doesn't have the music, but if you want to try it out without installing it from the Chrome Store, this is the link for you: