-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdnd_char_roller.py
More file actions
71 lines (58 loc) · 2.08 KB
/
Copy pathdnd_char_roller.py
File metadata and controls
71 lines (58 loc) · 2.08 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
60
61
62
63
64
65
66
67
68
69
70
71
# Day 25
# Need this for the randomizer.
import random
#Begin the program.
print("---------------------------")
print(" Character Stat Generator ")
print("---------------------------")
print()
char_name = input("What is your character's name? ")
char_species = input("What is your character species? ")
char_class = input("What is your character class? ")
print()
print("Now, let's roll up some ability scores for", char_name)
print()
# Values for the variables at hand.
str_roll = ""
str_dice = 6
#For str
def str_roller(str_dice):
# for i in range (4):
str_roll1 = random.randint(1, str_dice)
str_roll2 = random.randint(1, str_dice)
str_roll3 = random.randint(1, str_dice)
str_roll4 = random.randint(1, str_dice)
# Check to see which roll is the lowest. Yes, this is a long way of doing it.
if str_roll1 < str_roll2 or str_roll1 < str_roll3 or str_roll1 < str_roll4:
str_roll = str_roll2 + str_roll3 + str_roll4
print("Your strength is", str_roll)
return str_roll
if str_roll2 < str_roll1 or str_roll2 < str_roll3 or str_roll2 < str_roll4:
str_roll = str_roll1 + str_roll3 + str_roll4
print("Your strength is", str_roll)
return str_roll
if str_roll3 < str_roll1 or strRoll3 < str_roll2 or strRoll3 < str_roll4:
str_roll = str_roll1 + str_roll2 + str_roll4
print("Your strength is", str_roll)
return str_roll
if str_roll4 < str_roll1 or str_roll4 < str_roll2 or str_roll4 < str_roll3:
str_roll = str_roll1 + str_roll2 + str_roll3
print("Your strength is", str_roll)
return str_roll
# Calls the strRoller(str_roll) subroutine.
str_roll = str_roller(strDice)
print("Your strength is", str_roll)
# subroutine has parameter called `number`
# number` shows how many numbers we want the pin to have
#def pin_picker(number):
# import random
#this is the empty string
# pin = ""
#for loop shows defined amount of random numbers
# for i in range(number):
#we want a string of random numbers between 0-9
# pin += str(random.randint(0,9))
# return pin
#4 means we want 4 random numbers
#myPin = pin_picker(4)
#print(my_pin)