Skip to content

Instantly share code, notes, and snippets.

@cameronmaske
Created December 27, 2014 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cameronmaske/ba75641467478e1dba3b to your computer and use it in GitHub Desktop.
Save cameronmaske/ba75641467478e1dba3b to your computer and use it in GitHub Desktop.
A script to call out twisters moves written in Python! Only works on OSX.
from random import choice
from time import sleep
from subprocess import call
if __name__ == '__main__':
colors = ["green", "yellow", "blue", "red", "in the air", "other player's choice"]
parts = ["left hand", "right hand", "right foot", "left foot"]
while True:
part = choice(parts)
color = choice(colors)
sentance = '{} {}'.format(part, color)
print sentance
# Only works on OSX!
call(['say', sentance])
sleep(7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment