-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrandom_direction_chooser.py
More file actions
27 lines (26 loc) · 978 Bytes
/
random_direction_chooser.py
File metadata and controls
27 lines (26 loc) · 978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#-------------------------------------------------------------------------------
# Name: Random direction chooser
# Purpose: Like a magic 8 ball, it tells you where to go in times when you
# do not trust your own intuition
#
# Author: tembov
#-------------------------------------------------------------------------------
import random
import time
import sys
def main():
direction = ["North", "East", "South", "West"]
choose = (str(raw_input("Do you want to choose a direction?"))).lower()
while choose != "yes" and choose != "no":
print ("I do not understand that. Please try again")
choose = (str(raw_input("Do you want to choose a direction?"))).lower()
else:
if choose == "yes":
go = random.choice(direction)
print ("Go to the " + go)
else:
print "Sorry to see you go"
time.sleep(2)
sys.exit()
if __name__ == '__main__':
main()