Dustin Sallings home



So, on Christmas, my kids decided they wanted to play twister. They wanted me to spin the thingy and call out moves for them. That got really boring after about five minutes.

I wrote a really simple python script to start calling the moves for me since the spinny thing was getting annoying, and would sometimes end up pointing between two colors or otherwise be too difficult to call.

The first version of the script looked like this:

#!/usr/bin/env python

import random

if __name__ == '__main__':
    colors=('red', 'green', 'yellow', 'blue')
    limbs=('left foot', 'right foot', 'left hand', 'right hand')

    print random.choice(limbs), random.choice(colors)

That was fine, but I still had to run it and call it out. Then I remembered that someone made a talking cat for OS X. All I needed to do was run the output of this thing through that, and there’d be speech and then I could go about my business and let the computer call moves for them.

I thought that was kind of cool, but wanted something a little…more. I ended up writing a full OS X desktop version complete with images, icons, a preference pane, etc…

The kids finished playing (using the prototype) long before I finished writing the app. It was fun for all of us, though. :)

If anyone wants to play a two-player version of twister, though, you can grab a copy.


Version 1.1

blog comments powered by Disqus