Skip to content

Instantly share code, notes, and snippets.

@XChrisUnknownX
Created September 12, 2018 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save XChrisUnknownX/f9dff6ccbf81862e08db8f821d313636 to your computer and use it in GitHub Desktop.
Save XChrisUnknownX/f9dff6ccbf81862e08db8f821d313636 to your computer and use it in GitHub Desktop.
chargen starter pack.py
import time
import random
def charactergen():
#SECTION BELOW PICKS GENDER AND NAME
import random
malenames = ["Gary", "Joshua",
"Christopher","Noah","Matthew","Michael","Scott","Anthony","Salvatore","William","Frank","Mark","Thomas","Carl","Claude","Vincent","James","Nathan","Stuart","Steven","Albert","Adam","Charles","Darius","Greg","Hank","Harold","Paul","Peter","Patrick","Constantine","Kevin","Robert","Raymond","Benjamin","Yuri","Jacob","Oswald","Robin","Nicholas","Jeremy","Leslie","Arnold","Jack","Bruce"]
femalenames = ["Jeanine","Joy","Jovanna","Christina","Christine","Helen","Patricia","Gwen","Whitney","Dawn","Jeanine","Miriam","Leyla","Brittany","Amy","Felicia","Whitney","Kayla","Karen","Yolanda","Yuri","Hannah","Deanna","Mary","Marie","Jane","Sara","Reyna","Laura","Wanda","Wilma","Brenda","Rebecca","Octavia","Caitlyn","Kate","Penelope","Leslie","Robin","Darlene","Doreen","Danielle","Rachel","Rosemarie","Anna","Stephanie","Nancy","Delilah","Diane","Renee","Beatrice","Sasha","Elle","Marjorie","Madeline","Theresa","Trish","Jamie","Lisa","Michelle"]
lastnames = ["Day","Deluna","Schwartz","Hernandez","Calderon","Cruz","Riccio","Smith","Johnson","Jones","Leo","Goldstein","Reich","Rodriguez","Rosenberg","Rosenblum","Campanelli","Dougherty","Doherty","Shearer","Ierardi","Gonzalez","Santos","Montalbano","Gerstein","Farber","Mayfield","Volz","Luna","Knight","Arriaga","Escobar","Hart","Wallace","Davis","Lorenzo","Silver","Lieberman","Payonk","Williams","Wadia","Cohen","Thompson","Vance","Thomas","Sylvestre","Moller","McCormack","Lindholm","Herrada","Wells","Jacobs","Galper","Cheng","Deng","Feng","Fink","Finkelstein","Roth","Rothstein","Chi","Salters","Silberger","Ramos","Vance","Vanderbilt","Bush","Clinton","Nedich","Nowak","Noles","Polaski","Diaz","Melendez","Lyons"]
space = " "
male = "male"
female = "female"
maleorfemale = random.choice([male,female])
if maleorfemale == male:
firstname = random.choice(malenames)
pronoun = "he"
possessive = "his"
possessives = "his"
objectpronoun = "him"
prefix = "Mr."
relationchild = random.choice(["father","dad"])
relationspouse = random.choice(["husband","groom"])
relationsibling = "brother"
relationniece = "uncle"
relationgrandchild = random.choice(["grandpa","grandfather"])
relationaunt = "nephew"
relationgrandfather = "grandson"
relationfather = "son"
manorwoman = "man"
boyorgirl = "boy"
else:
firstname = random.choice(femalenames)
pronoun = "she"
possessive = "her"
possessives = "hers"
objectpronoun = "her"
prefix = "Ms."
relationchild = random.choice(["mother","mom"])
relationspouse = random.choice(["bride","wife"])
relationsibling = "sister"
relationniece = "aunt"
relationgrandchild = random.choice(["grandma","grandmother"])
relationaunt = "niece"
relationgrandfather = "granddaughter"
relationfather = "daughter"
manorwoman = "woman"
boyorgirl = "girl"
lastname = random.choice(lastnames)
name = (firstname + space + lastname)
# THE SECTION ABOVE PICKS GENDER AND NAME
# The section below will pick eye color, hair color, whether or not the character is a liar,
brown = "brown"
blue = "blue"
green = "green"
red = "red"
black = "black"
white = "white"
gray = "gray"
blonde = random.choice(["yellow","blonde"])
eyecolors = [brown,blue,green,gray]
haircolors = [blonde,brown,gray,white,black]
trueorfalse = [True,False]
eyecolor = random.choice(eyecolors)
haircolor = random.choice(haircolors)
isaliar = random.choice([True,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False])
#section above is eye color, hair color, whether character is a liar
# section below decides hair length
length = random.choice(["long","short"])
#section above decides hair length
# section below generates the character list
character = [maleorfemale,name,firstname,lastname,pronoun,possessive,possessives,objectpronoun,relationchild,relationspouse,eyecolor,haircolor,isaliar,prefix,length,relationsibling,relationniece,relationgrandchild,relationaunt,relationgrandfather,relationfather,manorwoman,boyorgirl]
# 0 maleorfemale, 1 full name, 2 first name, 3 last name, 4 pronoun, 5 possessive, 6 possessives, 7 objectpronoun, 8 relation to a child, 9 relation to a spouse, 10 eye color, 11 hair color, 12 isaliar True or False, 13 prefix, 14 length, 15 relation to a sibling, 16 relation to a niece or nephew, 17 relation to a grandchild, 18 relation to an aunt or uncle, 19 relation to a grandfather, 20 relation to a parent, 21 man or woman, 22 boy or girl
return character
def canberelated(x, y):
#A function usable with the chargen function to determine if two characters can be related.
if x == "male" and y == "female":
xmaleandyfemale = True
xmaleandymale = False
xfemaleandymale = False
xfemaleandyfemale = False
elif x == "female" and y == "male":
xmaleandyfemale = False
xmaleandymale = False
xfemaleandymale = True
xfemaleandyfemale = False
elif x == "male" and y == "male":
xmaleandyfemale = False
xmaleandymale = True
xfemaleandymale = False
xfemaleandyfemale = True
elif x == "female" and y == "female":
xmaleandyfemale = False
xmaleandymale = False
xfemaleandymale = False
xfemaleandyfemale = True
else:
xmaleandyfemale = False
xmaleandymale = False
xfemaleandymale = False
xfemaleandyfemale = False
pass
relationshippossibilities = [xmaleandyfemale,xmaleandymale,xfemaleandymale,xfemaleandyfemale]
#creates a list with
# 0 x male y female,
# 1 x male x male,
# 2 x female y male,
# 3 and x female y female.
# returns true or false
return relationshippossibilities
#this code is designed to test the functions. disabled by a value of False.
testing = True
if testing == True:
char1 = charactergen()
char2 = charactergen()
char3 = charactergen()
char4 = charactergen()
char5 = charactergen()
char6 = charactergen()
char7 = charactergen()
char8 = charactergen()
char9 = charactergen()
char10 = charactergen()
char1andchar2 = canberelated(char1[0],char2[0])
char1andchar3 = canberelated(char1[0],char3[0])
horatio = False
if char1andchar2[0] == True and horatio == True:
print(char1[1] + " is a " + char1[0] + " and may be " + char2[1]+"'s " + char1[8] + ", making "+ char2[1] +" a " + char2[0] + " and " + char1[5] + " " + char2[20] + ".")
else:
pass
print()
print(char1[1] + " is a " + char1[0] + " and " + char2[1] + " is a " + char2[0] + ". Therefore, logically, " + char1[2] + " may be "+ char2[2]+"'s " + char1[8] + " and " + char2[2] + " may be " + char1[2]+"'s " + char2[20] + ". To decide whether " + char1[2] + " is " + char2[5] + " " + char1[8] + ", the computer only determines the gender of the characters, and fills the rest using rules of language. Succinctly, if we say that " + char1[1] + " is " + char1[0]+ ", then the following sentence will always read correctly: " + char1[1] + " is a nice " + char1[21] + ". So " + char1[4] + " went to the store to buy " + char1[5] + " " + char2[20] + ", " + char2[1]+", " + char2[5] + " brand new clothes. Because of this, " + char2[4] + " was so grateful for the new clothes that " + char2[4] + " made " + char2[5] + " " + char1[8] + " a card saying thanks.")
print()
else:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment