Skip to content

Instantly share code, notes, and snippets.

@RemyPorter
Last active August 29, 2015 14:07
Show Gist options
  • Save RemyPorter/a75fedc1b31d2f408816 to your computer and use it in GitHub Desktop.
Save RemyPorter/a75fedc1b31d2f408816 to your computer and use it in GitHub Desktop.
import random
choices = ["da","ja"]
truth = random.choice(choices)
false =[c for c in choices if c != truth]
false = false[0]
gods = [lambda: truth, lambda: false, lambda: random.choice(choices)]
a = random.choice(gods)
b = a
while b == a:
b = random.choice(gods)
c = a
while c == a or c == b:
c = random.choice(gods)
# at this point, a, b, and c are randomly selected gods. Each returns "ja", or "da", to mean true or false, but that's also random
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment