Skip to content

Instantly share code, notes, and snippets.

@dionyziz
Created December 9, 2019 10:50
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 dionyziz/234872d074632b8c409ce423505182b5 to your computer and use it in GitHub Desktop.
Save dionyziz/234872d074632b8c409ce423505182b5 to your computer and use it in GitHub Desktop.
def ask(r):
p <- [0, 1] # define whether we will speak the truth or not
s <- [0, 1] # define "ya" as "yes" or "no" randomly
if r: # question has truthful answer
if p: # we are speaking the truth
if s: # the meaning of "ya" is "yes"
return "ya"
else:
return "da"
else: # we are lying
if s: # the meaning of "ya" is "yes"
return "da"
else:
return "ya"
else: # the question has falsy answer
if p: # we are speaking the truth
if s: # the meaning of "ya" is "yes"
return "da"
else:
return "ya"
else: # we are lying
if s: # the meaning of "ya" is "yes"
return "ya"
else:
return "da"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment