Aschenblog: Thoughts on Code and Fabrication

Game Time

My team laughed quite a bit recently while playing Pictionary at lunchtime over the past several weeks. We have had a few HR (not safe for work) fails in addition to several entertaining missed phrases (including Pizza Gazebo instead of Pizza Hut). We use tablets as our drawing surfaces to save paper, which introduces challenges when trying to draw rapidly. To find words, we used the Game Gal’s word generator.

I love words and decided to look at the word generator implementation to see if I could see if I could use their API to get categorized word lists. I used Chrome’s POSTman tool to issue GET requests to the following URL:

1
https://www.thegamegal.com/wordgenerator/generator.php?game=2&category=6

The 2 is pictionary and 6 is for the easy category. See the generator.js file or look at the word generator DOM for more details.

I decided to compile a complete list of all words, phrases, actions, characters, movies, songs, etc from the site into a tool that others can use. The GameWords gem was born (Github, RubyGems). This tool is both a Ruby library and has a command line interface. Below we will investigate the command line tool options:

To install the GameWords gem (which requires Ruby) from a terminal:

1
$ gem install game_words

Running the command with no options will show the help:

1
2
3
4
5
6
7
$ gamewords
Usage: gamewords [options] game [category]
    -l, --list                       List games
    -c, --categories GAME            List categories for a GAME
    -r, --random                     Show one random word or phrase for a GAME [CATEGORY]
    -v, --version                    Show the version
    -h, --help                       Display help screen

To find a Pictionary word for all categories:

1
$ gamewords pictionary

Show all words for a specific game category:

1
$ gamewords catchphrase people

Show a list of games with the -l option:

1
$ gamewords -l

Show a list of categories for a game via the -c option:

1
$ gamewords -c pictionary

Show a single random word or phrase use the -r option:

1
$ gamewords -r charades actions

The holidays are a great chance to catch up with family and close friends. If you like word games perhaps this library can provide some incentive to either play or write your own word games. There are almost 5,000 words, phrases, songs, movies, characters, actions and sayings.

Happy Holidays!

Comments