Python code for Project Think 2018

Briefcase.py

# Escape the Room
# Emily Hao, MaryAnn VanValkenburg, and Suzanne Mello-Stark

#2, 3, 5, 6, 23, 26, 29

def main():
print(‘ ‘)
print(‘You have only 3 tries to answer this question!’)
print(‘Don\’t forget to put quotation marks BEFORE AND AFTER your answer!!’)
print(‘ ‘)
i = 0;
while (i < 3):
print(‘ ‘)
print(‘What is the combination (XXXXXX)?’)
combination = input(‘(To escape script, type “e”)\n’)
if (combination == “e”):
return;
if (combination == “013088”):
print(“Correct! Take card #7\n”)
return;
elif (i == 0): # First incorrect guess
print(“Incorrect, try again.\n”)
i = i+1
elif (i == 1): # Second incorrect guess
print(“Incorrect, try birthday MMDDYY.\n”)
i = i+1
else: # Three strikes you’re out!
print(“Incorrect. Take card #15\n”)
i = i+1
return;

if __name__ == “__main__”:
main()

Laptop.py

# Escape the Room
# Emily Hao, MaryAnn VanValkenburg, and Suzanne Mello-Stark

#2, 3, 5, 6, 23, 26, 29

def main():
print(‘ ‘)
#blue
print(‘You have only 3 tries to answer this question!’)
print(‘Don\’t forget to put quotation marks BEFORE AND AFTER your answer!!’)
print(‘ ‘)
i = 0;
while (i < 3):
print(‘ ‘)
print(‘What is Suzanne\’s laptop password? ***Hint: One word, all lowercase!***’)
combination = input(‘(To escape the script, type “e”)\n’)
if (combination == “e”):
return;
if (combination == “password”):
print(“Correct! Take card #8\n”)
return;
elif (i == 0): # First incorrect guess
#red
print(“Incorrect, try a very obvious and insecure password.\n”)
i = i+1
elif (i == 1): # Second incorrect guess
print(“Incorrect, try again (lowercase).\n”)
i = i+1
else: # Three strikes you’re out!
print(“Incorrect. See GenCyber Leaders for card #29\n”)
i = i+1
return;

if __name__ == “__main__”:
main()

 

Oranges.py

# Escape the Room
# Emily Hao, MaryAnn VanValkenburg, and Suzanne Mello-Stark

#2, 3, 5, 6, 23, 26, 29

def main():
print(‘ ‘)
print(‘You have only 3 tries to answer this question!’)
print(‘Don\’t forget to put quotation marks BEFORE AND AFTER your answer!!’)
print(‘ ‘)
i = 0;
while (i < 3):
print(‘ ‘)
print(‘When will Suzanne attack? (Example: November 21)’)
combination = input(‘(To escape script, type “e”)\n’)
if (combination == “e”):
return;
if (combination == “June 7” or combination == “June 07”):
print(“Correct! See GenCyber Leaders for card #6\n”)
return;
elif (i == 0): # First incorrect guess
print(“Incorrect, try again.\n”)
i = i+1
elif (i == 1): # Second incorrect guess
print(“Incorrect, be sure to read the codebook carefully.\n”)
i = i+1
else: # Three strikes you’re out!
print(“Incorrect. See GenCyber Leaders for card #2\n”)
i = i+1
return;

if __name__ == “__main__”:
main()

 

Phone.py

# Escape the Room
# Emily Hao, MaryAnn VanValkenburg, and Suzanne Mello-Stark

#2, 3, 5, 6, 23, 26, 29

def main():
print(‘ ‘)
print(‘You have only 3 tries to answer this question!’)
print(‘Don\’t forget to put quotation marks BEFORE AND AFTER your answer!!’)
print(‘ ‘)
i = 0;
while (i < 3):
print(‘ ‘)
print(‘What is the password to Suzanne\’s cell phone? ***Hint: All lowercase and NO space!***’)
combination = input(‘(To escape script, type “e”)\n’)
if (combination == “e”):
return;
if (combination == “enigmamachine”):
print(“Correct! Take card #14\n”)
return;
elif (i == 0): # First incorrect guess
print(“Incorrect, try again.\n”)
i = i+1
elif (i == 1): # Second incorrect guess
print(“Incorrect, try again (LOWERCASE AND NO SPACE).\n”)
i = i+1
else: # Three strikes you’re out!
print(“Incorrect. Take card #30\n”)
i = i+1
return;

if __name__ == “__main__”:
main()

 

Target.py

# Escape the Room
# Emily Hao, MaryAnn VanValkenburg, and Suzanne Mello-Stark

#2, 3, 5, 6, 23, 26, 29

def main():
print(‘ ‘)
print(‘You have only 3 tries to answer this question!’)
print(‘Don\’t forget to put quotation marks BEFORE AND AFTER your answer!!’)
print(‘ ‘)
i = 0;
while (i < 3):
print(‘ ‘)
print(‘Who will Suzanne attack? (Example: John Doe)’)
combination = input(‘(To escape script, type “e”)\n’)
if (combination == “e”):
return;
if (combination == “Zoe Walker”):
print(“Correct! See GenCyber Leaders for card #23\n”)
return;
elif (i == 0): # First incorrect guess
#red
print(“Incorrect, try again.\n”)
i = i+1
elif (i == 1): # Second incorrect guess
#red
print(“Incorrect, try first and last name with a space.\n”)
i = i+1
else: # Three strikes you’re out!
#red
print(“Incorrect. See GenCyber Leaders for card #5\n”)
i = i+1
return;

if __name__ == “__main__”:
main()

 

Train.py

# Escape the Room
# Emily Hao, MaryAnn VanValkenburg, and Suzanne Mello-Stark

#2, 3, 5, 6, 23, 26, 29

def main():
print(‘ ‘)
print(‘You have only 3 tries to answer this question!’)
print(‘Don\’t forget to put quotation marks BEFORE AND AFTER your answer!!’)
print(‘ ‘)
i = 0;
while (i < 3):
print(‘ ‘)
print(‘Where will Suzanne attack? (Example: San Bernardino)’)
combination = input(‘(To escape script, type “e”)\n’)
if (combination == “e”):
return;
if (combination == “Disneyland Anaheim”):
print(“Correct! See GenCyber Leaders for card #3\n”)
return;
elif (i == 0): # First incorrect guess
print(“Incorrect, try again.\n”)
i = i+1
elif (i == 1): # Second incorrect guess
print(“Incorrect, there is NO space between words and the first letter of each word is capitalized.\n”)
i = i+1
else: # Three strikes you’re out!
print(“Incorrect. See GenCyber Leaders for card #26\n”)
i = i+1
return;

if __name__ == “__main__”:
main()

 

Wallet.py

# Escape the Room
# Emily Hao, MaryAnn VanValkenburg, and Suzanne Mello-Stark

#2, 3, 5, 6, 23, 26, 29

import subprocess

def main():
print(‘ ‘)
#blue
print(‘You have only 3 tries to answer this question!’)
print(‘Don\’t forget to put quotation marks BEFORE AND AFTER your answer!!’)
print(‘ ‘)
i = 0;
while (i < 3):
print(‘ ‘)
print(‘What is the combination to her wallet (XXX)?’)
combination = input(‘(To escape script, type “e”)\n’)
if (combination == “e”):
return;
if (combination == “798”):
print(“Correct! Take card #9\n”)
return;
elif (i == 0): # First incorrect guess
print(“Incorrect, try again.\n”)
i = i+1
elif (i == 1): # Second incorrect guess
print(“Incorrect, look carefully at the watch.\n”)
i = i+1
else: # Three strikes you’re out!
print(“Incorrect. Take card #33\n”)
i = i+1
return;

if __name__ == “__main__”:
main()