Skip to content

Instantly share code, notes, and snippets.

@aturley
Created June 2, 2012 01:09
Show Gist options
  • Save aturley/2856030 to your computer and use it in GitHub Desktop.
Save aturley/2856030 to your computer and use it in GitHub Desktop.
That's Numberwang!
import random, sys, os
name = [None, None]
sys.stdout.write("enter player 1: ")
sys.stdout.flush()
name[0] = sys.stdin.readline().strip()
sys.stdout.write("enter player 2: ")
sys.stdout.flush()
name[1] = sys.stdin.readline().strip()
p = 0
first = True
while random.random() > 0.1 or started:
started = False
sys.stdout.write("player %s: "%(name[p]))
sys.stdout.flush()
sys.stdin.readline()
p = (p + 1) % 2
os.system("""say "that's numberwang" """)
print "That's Numberwang!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment