SHOW:
|
|
- or go back to the newest paste.
1 | import random | |
2 | def generateNums (t,pn,d): | |
3 | print ("*", pn, "wants to expand", d, t, "times.*") | |
4 | for i in range(t): | |
5 | print(pn, "rolled", random.randrange(1,10001), "and expanded x territories", d) | |
6 | #too much work to calculate x, better off checking myself. | |
7 | def calcTurns (p, t): | |
8 | y = t + (15-t/10) | |
9 | if y>t: | |
10 | print (p, "has", int(y), "turns for the next round.") | |
11 | else: | |
12 | print (p, "has", t, "turns for the next round.") | |
13 | ||
14 | pname = input ("Player name?") | |
15 | ||
16 | x = str(input("Random numbers, turn calculation or fights?")) | |
17 | if x in ["r", "random", "random numbers", "Random", "R", "Random numbers"]: | |
18 | direc = input ("Direction to expand? (lowercase)") | |
19 | turnsUsed = input("Turns used?") | |
20 | generateNums (int(turnsUsed),pname,direc) | |
21 | elif x in ["t", "T", "turns", "turn", "turncalc", "turn calculation", "calculate turns"]: | |
22 | currTurns = int(input("Current Turns?")) | |
23 | calcTurns(pname, currTurns) | |
24 | elif x in ["fight", "f", "F", "fights"]: | |
25 | aa = 0 | |
26 | oppname = input("opponent name?") | |
27 | y = input("range? (100,110,120,150,180,200,220)") | |
28 | if y == "100": | |
29 | for i in range(int(input("Amount of fights?"))): | |
30 | z = int(random.randrange(1,101)) | |
31 | if z<51: | |
32 | print(pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
33 | z = int(random.randrange(1,101)) | |
34 | aa+=3 | |
35 | if z<51: | |
36 | print (" ", pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
37 | z = int(random.randrange(1,101)) | |
38 | aa+=3 | |
39 | if z<51: | |
40 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
41 | z = int(random.randrange(1,101)) | |
42 | aa+=3 | |
43 | if z<51: | |
44 | print (" ", pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
45 | aa+=3 | |
46 | else: | |
47 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
48 | else: | |
49 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
50 | else: | |
51 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
52 | else: | |
53 | print(pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
54 | elif y == "110": | |
55 | for i in range(int(input("Amount of fights?"))): | |
56 | z = int(random.randrange(1,111)) | |
57 | y=110 | |
58 | if z<61: | |
59 | print(pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
60 | z = int(random.randrange(1,101)) | |
61 | y=100 | |
62 | aa+=3 | |
63 | if z<51: | |
64 | print (" ", pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
65 | z = int(random.randrange(1,101)) | |
66 | aa+=3 | |
67 | if z<51: | |
68 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
69 | z = int(random.randrange(1,101)) | |
70 | aa+=3 | |
71 | if z<51: | |
72 | print (" ", pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
73 | aa+=3 | |
74 | else: | |
75 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
76 | else: | |
77 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
78 | else: | |
79 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
80 | else: | |
81 | print(pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
82 | elif y == "120": | |
83 | for i in range(int(input("Amount of fights?"))): | |
84 | z = int(random.randrange(1,121)) | |
85 | y = 120 | |
86 | if z<71: | |
87 | print(pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
88 | z = int(random.randrange(1,101)) | |
89 | aa+=3 | |
90 | y = 100 | |
91 | if z<51: | |
92 | print (" ", pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
93 | z = int(random.randrange(1,101)) | |
94 | aa+=3 | |
95 | if z<51: | |
96 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
97 | z = int(random.randrange(1,101)) | |
98 | aa+=3 | |
99 | if z<51: | |
100 | print (" ", pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
101 | aa+=3 | |
102 | else: | |
103 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
104 | else: | |
105 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
106 | else: | |
107 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
108 | else: | |
109 | print(pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
110 | elif y == "150": | |
111 | for i in range(int(input("Amount of fights?"))): | |
112 | z = int(random.randrange(1,151)) | |
113 | y=150 | |
114 | if z<101: | |
115 | print(pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
116 | aa+=3 | |
117 | z = int(random.randrange(1,101)) | |
118 | y = 100 | |
119 | if z<51: | |
120 | print (" ", pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
121 | aa+=3 | |
122 | z = int(random.randrange(1,101)) | |
123 | if z<51: | |
124 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
125 | aa+=3 | |
126 | z = int(random.randrange(1,101)) | |
127 | if z<51: | |
128 | print (" ", pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
129 | aa+=3 | |
130 | else: | |
131 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
132 | else: | |
133 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
134 | else: | |
135 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
136 | else: | |
137 | print(pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
138 | elif y == "180": | |
139 | for i in range(int(input("Amount of fights?"))): | |
140 | z = int(random.randrange(1,181)) | |
141 | y=180 | |
142 | if z<131: | |
143 | print(pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
144 | aa+=3 | |
145 | z = int(random.randrange(1,101)) | |
146 | y = 100 | |
147 | if z<51: | |
148 | print (" ", pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
149 | aa+=3 | |
150 | z = int(random.randrange(1,101)) | |
151 | if z<51: | |
152 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
153 | aa+=3 | |
154 | z = int(random.randrange(1,101)) | |
155 | if z<51: | |
156 | print (" ", pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
157 | aa+=3 | |
158 | else: | |
159 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
160 | else: | |
161 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
162 | else: | |
163 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
164 | else: | |
165 | print(pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
166 | elif y == "200": | |
167 | for i in range(int(input("Amount of fights?"))): | |
168 | z = int(random.randrange(1,201)) | |
169 | y=200 | |
170 | if z<151: | |
171 | print(pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
172 | aa+=3 | |
173 | z = int(random.randrange(1,101)) | |
174 | y = 100 | |
175 | if z<51: | |
176 | print (" ", pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
177 | aa+=3 | |
178 | z = int(random.randrange(1,101)) | |
179 | if z<51: | |
180 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
181 | aa+=3 | |
182 | z = int(random.randrange(1,101)) | |
183 | if z<51: | |
184 | print (" ", pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
185 | aa+=3 | |
186 | else: | |
187 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
188 | else: | |
189 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
190 | else: | |
191 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
192 | else: | |
193 | print(pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
194 | elif y == "220": | |
195 | for i in range(int(input("Amount of fights?"))): | |
196 | z = int(random.randrange(1,221)) | |
197 | y=220 | |
198 | if z<171: | |
199 | print(pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
200 | aa+=3 | |
201 | z = int(random.randrange(1,101)) | |
202 | y = 100 | |
203 | if z<51: | |
204 | print (" ", pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
205 | aa+=3 | |
206 | z = int(random.randrange(1,101)) | |
207 | if z<51: | |
208 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
209 | aa+=3 | |
210 | z = int(random.randrange(1,101)) | |
211 | if z<51: | |
212 | print (" ", pname, "rolled", z, "out of", y, "-", pname, "conquers 3 territories from", oppname) | |
213 | aa+=3 | |
214 | else: | |
215 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
216 | else: | |
217 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
218 | else: | |
219 | print(" ", pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
220 | else: | |
221 | print(pname, "rolled", z, "out of", y, "-", pname, "fails to conquer.") | |
222 | print("For a total of", aa, "territories!") | |
223 | else: | |
224 | raise Exception("That is not a valid input.") |