-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCamel game
101 lines (76 loc) · 2.89 KB
/
Camel game
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
print("\nWelcome to Camel!","\nYou have stolen a camel to make your way across the great Mobi desert.","\nThe natives want their camel back and are chasing you down! Survive your","\ndesert trek and out run the natives.")
import random
done = False
miles_traveled = 0
thirst = 0
camel_tired = 0
natives_traveled = -20
drink = 5
natives_up = random.randrange(0, 10)
full_speed = random.randrange(10, 20)
moderate_speed = random.randrange(5, 12)
while not done:
print("\nA. Drink from your canteen .","\nB. Ahead moderate speed.","\nC. Ahead full speed.","\nD. Stop for the night.","\nE. Status check.","\nQ. Quit.")
choice = input("Your choice? ")
if choice == "q":
done = True
#status_check
elif choice == "e":
print ("\nMiles traveled: %d\nDrinks in canteen: %d\nThe natives are %d behind you. \nCamel tiredness %d \nThirst level are %d" %(miles_traveled, drink, natives_traveled, camel_tired, thirst,))
#stop_for_the_night
elif choice == "d":
camel_tired = 0
print ("The camel is happy! and move the natives up %d miles" %(natives_up,))
#full_speed
elif choice == "c":
print ("you have traveled %d miles" %(full_speed,))
miles_traveled = miles_traveled + full_speed
natives_traveled = natives_traveled + natives_up
thirst = thirst + 1
camel_tired = random.randrange(1,3)
print ("camel tiredness %d" %(camel_tired,))
print ("move the natives up to %d miles" %(natives_up,))
#moderate_speed
elif choice == "b":
print ("you have traveled %d miles" %(moderate_speed,))
miles_traveled += full_speed
natives_traveled += natives_up
thirst += 1
camel_tired = camel_tired + random.randrange(1,3)
print ("camel tiredness %d" %(camel_tired,))
print ("move the natives up to %d miles" %(natives_up,))
#drink_to_canteen
elif choice == "a":
print ("you drink from your canteen")
drink = drink - 1
thirst = 0
#you are thirst
if thirst >= 3 :
print ("you are thirsty!!!!!")
#you died of thirst!
if thirst >= 5 :
print ("you died of thirsty!!!")
done = True
#your camel is getting tired!
if camel_tired >= 5:
print ("your camel is getting tired")
#your camel is dead
if camel_tired >= 8:
print ("Your camel is dead")
done = True
#if the natives have caught up
if natives_traveled >= 0:
print ("The natives caught you")
done = True
#the natives are walking
elif natives_traveled >= -10:
print ("The natives getting close")
if miles_traveled == 300:
print ("You won and you got the camel arround the mobi desert")
done = True
if drink <= 0:
print ("The drink are out of stock!!!")
thirst = 0
drink = done
elif thirst >= 1:
miles_traveled -= 1