-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpig_game.py
More file actions
59 lines (38 loc) · 1.45 KB
/
Copy pathpig_game.py
File metadata and controls
59 lines (38 loc) · 1.45 KB
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
#JSkye
import random
import string
import sys
saved_roll = 0
bot_score = 0
man_score = 0
debug = 0
attempt = 0
def slightOfHand():
cheat.randint(0,1000)
def dice_roll():
di_roll.randint(1,6)
def randomString(stringLength=5000):
"""Generate a random string of fixed length """
letters = string.ascii_lowercase
return ''.join(random.choice(letters) for i in range(stringLength))
def roll_dice(debug, mode):
hold = 1
while hold == 1:
di_roll = dice_roll()
if debug == 1:
print("\n #####DEBUG#####\n Returned " + di_roll)
if mode == 1:
print("**********************\nHUMAN, YOU ROLLED " + di_roll +"\n******************")
if di_roll > 4:
print("BOOOOO!!! don't keep it I dare you!")
answer = input("***KEEP?***\n<Press ENTER to keep rolling, or type yes/y to keep.>")
if mode == 2:
print("**********************\n BOT ROLLED " + di_roll +"\n******************")
if di_roll > 1:
print("ANOTHER SUCCESFULL MOVE")
answer = input("***KEEP?***\n<Press ENTER to keep rolling, or type yes/y to keep.>")
def main():
bot_name = randomString(5)
name = input("HUMAN: \n PLEASE STATE YOUR NAME: ")
print("WELCOME HUMAN "+ name + " YOU ARE DESTINED TO PLAY A GAME WITH THE \nEVIL ROBOT OVERLORD NAMED " + bot_name + "!!!")
main()