Guest User

Untitled

a guest
Oct 17th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.79 KB | None | 0 0
  1. import random
  2. import time
  3. # going to create a starter pack for text games in Python.
  4. #
  5. #
  6. #
  7. #
  8. #
  9. # choices is going to accept a, an integer, how many choices you're giving a player.
  10. # for best results, tell the player what the choices are before hand, and that they should only enter the number given.
  11. # choices returns the integer of the choice, 1 to a
  12. # EXAMPLE:
  13. # print("You are going to the store. Do you want to...1. go to the store? 2. eat chicken. 3. Sing!")
  14. # choices(3)
  15. def choices(a):
  16. while True:
  17. astringy = str(a)
  18. selection = input("Enter the number of your choice: ")
  19. try:
  20. selectioninteger = int(selection)
  21. if selectioninteger < 1:
  22. print("You cannot enter a number less than 1.")
  23. continue
  24. elif selectioninteger > a:
  25. print("You cannot enter a number greater than " + astringy + ".")
  26. continue
  27. else:
  28. break
  29. except:
  30. print("You must enter a number.")
  31. continue
  32. return selectioninteger
  33.  
  34. # choices test pack, part of testsuite().
  35. def choicestest():
  36. print("You are going to the store. Do you want to...1. Go to the store? 2. Eat a chicken! 3. Sing!")
  37. answer = choices(3)
  38. if answer == 1:
  39. print("You go to the store.")
  40. elif answer == 2:
  41. print("You eat a chicken.")
  42. elif answer == 3:
  43. print("You sing!")
  44. else:
  45. print("The code is bugged! Maybe a float was given?")
  46. input("End of choices test. Enter to continue.")
  47.  
  48. # createcharacter() creates a list with various character traits that can be used to correctly relate any random character to any random character. Being a list, its traits are also modifiable as needed.
  49. def createcharacter():
  50. #This very first part decides the character's name and gender.
  51. malenames = ["Andrew","Anthony","Angel","Abel","Alexander","Allen","Alan","Aaron","Axel","Adam","Ari","Abraham","Antonio","Augustus","Amir","Abdi","Alfred","Alvin","Andre","Andres","Arthur","Angelo","Albert","Arman","Ace","Alejandro","Armando","Bernard","Bjorn","Bernie","Barney","Bailey","Billy","Barry","Ben","Bruce","Benjamin","Booker","Bob","Barnabus","Baird","Brian","Bryan","Brock","Boggy","Boris","Christopher","Claude","Charles","Cornelius","Charlie","Chris","Carl","Chase","Corey","Connor","Craig","Clifford","Cyrus","Chopper","Chad","Constantine","David","Dominic","Dominick","Domenick","Dan","Daniel","Daven","Darius","Don","Donald","Dick","Darren","Daryl","Dwayne","Dane","Drake","Desmond","Doc","Dennis","Dimitri","Dale","Dante","Edgar","Edward","Edwin","Edmond","Edmund","Ed","Edd","Eric","Eddie","Elijah","Elton","Ernie","Frank","Fred","Fredrick","Frederick","Frederico","Forest","Falco","Fenton","Gary","Garry","Greg","Gabriel","Gregg","Gerard","Gilbert","Glen","Glenn","Hank","Herbert","Hercules","Hani","Hugo","Hector","Horace","Harry","Harold","Igor","John","Jacob","Jon","Jesus","Jakub","Jeremy","Jonathan","Jeffrey","Johanathan","Johnathan","Jaime","Jamie","James","Jerry","Jim","Jimmy","Junior","Jack","Jake","Jeremiah","Josh","Joshua","Jaquan","Kris","Kristopher","Ken","Kenny","Kenneth","Kyle","Konstantine","Kristofer","Kobi","Kobe","Kevin","Keith","Lewis","Luis","Lambert","Linus","Loki","Lonny","Lenny","Luke","Lucas","Lester","Lukas","Lars","Lance","Loren","Marcus","Mark","Markus","Marc","Michael","Leslie","Larry","Lawrence","Mike","Mikhail","Martin","Marty","Melvin","Morgan","Mallow","Matthew,","Matt","Manny","Moe","Max","Morris","Milo","Montel","Maximus","Mordred","Merlin","Nathan","Nathaniel","Nick","Nicholas","Nikolas","Neil","Nik","Noggy","Oggy","Ozzy","Oswald","Oliver","Oz","Orlan","Orion","Omar","Peter","Piotr","Patrick","Pablo","Paco","Packie","Patrizio","Perseus","Pat","Paul","Poe","Paulie","Quin","Quinn","Quenton","Quinten","Quintin","Quade","Richie","Richard","Rich","Ryan","Ron","Ronald","Remy","Randy","Raymond","Rupert","Randolph","Randolf","Regnier","Raz","Rick","Ricky","Ricardo","Raul","Robert","Rob","Roc","Rocco","Sam","Samuel","Sargon","Steve","Steven","Stephen","Stephan","Syed","Sammy","Saul","Sean","Shawn","Sal","Salvatore","Simon","Stuart","Stu","Stewart","Sonny","Thomas","Thom","Tom","Travis","Tim","Timothy","Tyler","Toren","Terry","Tor","Theodore","Thor","Tai","Uther","Ulfric","Ugo","Vincent","Vance","Vinny","Vin","Wen","Waldo","Walter","Wayne","William","Will","Wally","Xin","Xavier","Yuri","Zoro","Zack","Zackary","Zachary","Zach","Zane"]
  52. # There are about 309 male names.
  53. femalenames = ["Anna","Ana","Annie","Alexandra","Agatha","Althea","Arlene","Ali","Amaya","Amy","Alexa","Alana","Alice","Alissandra","Angel","Amanda","Alexandria","Ami","Anya","Anju","Aria","Anne","Ann","Allison","Allyson","Aniyah","Brittany","Britt","Beth","Bethany","Barbara","Bonnie","Bonny","Becca","Bekah","Bess","Bessany","Christina","Christine","Courtney","Christin","Celestine","Christi","Cristi","Carri","Caroline","Carolina","Carolea","Caylee","Cate","Catelyn","Celia","Cecelia","Casandra","Cassy","Casaundra","Corrin","Carmen","Constantina","Cornelia","Cora","Dalia","Dalila","Delilah","Dani","Danielle","Dorris","Debra","Deborah","Destiny","Dana","Dorothy","Dora","Denise","Dolores","Dori","Diane","Donna","Doreen","Dawn","Deanna","Dina","Deena","Dee","Ella","Elle","Ellie","Elvira","Ester","Erica","Elizabeth","Elisabeth","Elena","Eileen","Emily","Erin","Eve","Evie","Frida","Frita","Flor","Fay","Freya","Fran","Francesca","Fanny","Gayle","Gail","Gwen","Gweneth","Gloria","Gabrielle","Guadalupe","Gabriella","Geanine","Gee","Georgina","Gela","Hailey","Hanna","Hannah","Haley","Harrah","Hela","Hellen","Helena","Hermoine","Holly","Irene","Irena","Ilana","Ilene","Ingrid","Jerri","Jerrine","Jeanine","Jovanna","Joyanna","Joy","Jane","Jayna","Jean","Jeanie","Jen","Jennifer","Jamie","Jackie","Jacquelyn","Jaquelyn","Julie","Julia","Jacqueline","Joanne","Jodie","Jesebelle","Jazmine","Jasmine","Krista","Kristin","Kirstin","Kristina","Kristine","Konstantina","Kaylee","Karen","Kora","Katelyn","Kate","Katie","Korrin","Kassy","Kasandra","Khaleesi","Kairi","Kasaundra","Kelly","Kylie","Kairi","Kari","Kendra","Kendria","Leslie","Loria","Lena","Lora","Laura","Lauren","Laurie","Leyla","Leelah","Lorelei","Luna","Lee","Linda","Lexi","Mika","Mariah","Melody","Melissa","Marie","Mary","Maria","Morticia","Marnie","Mable","Monique","Monica","Miley","Michelle","Michele","Molly","Micelle","Madeline","Mikela","Michaela","Monika","Marjorie","Moria","Maureen","Melony","Melinda","Melissandra","Moreen","Nelly","Nicole","Nikki","Nancy","Ovelia","Ophelia","Olivia","Omnia","Odessa","Patricia","Penelope","Persephone","Paula","Pauline","Paulina","Pat","Polly","Polina","Quintana","Quina","Rachel","Renee","Rebecca","Raven","Raquel","Racquel","Reyna","Roni","Rori","Sally","Sara","Sarah","Sonia","Saria","Selene","Susan","Suzanne","Susie","Selena","Selestine","Simone","Selestina","Sandy","Sharon","Saliyah","Sandra","Saundra","Sasha","Trish","Tricia","Tess","Tish","Trisha","Theresa","Therese","Teresa","Terese","Talia","Taliyah","Thea","Theodora","Tyrene","Tabatha","Terry","Tracy","Tyanna","Tianna","Tiara","Tyara","Tylena","Tracey","Ula","Vinchenza","Valerie","Victoria","Vicky","Vick","Vickie","Wilma","Xena","Xaria","Yuri","Yolanda","Zena","Zalia","Zaria"]
  54. #There are about 309 female names.
  55.  
  56. lastnames = ['Akina', 'Alderman', 'Aliaga', 'Almog', 'Amelkin', 'Angeles', 'Ansari', 'Appel', 'Arena', 'Arias', 'Armstrong', 'Arriaga', 'Ashworth', 'Baez', 'Bannister', 'Barclay', 'Beal', 'Benson', 'Bergen', 'Bhuyan', 'Braver', 'Bravo', 'Breakstone', 'Briody', 'Brodowski', 'Brown', 'Buchanan', 'Buckmeier', 'Calderon', 'Callahan', 'Carberry', 'Carny', 'Casler', 'Castle', 'Castler', 'Cerruti', 'Chandler', 'Chang', 'Chi', 'Chilelli', 'Chong', 'Christobek', 'Cleland', 'Cleveland', 'Clott', 'Cohen', 'Collins', 'Colon', 'Cotto', 'Dapelo', 'Dartt', 'Das', 'Dauman', 'Davidson', 'Davila', 'Day', 'Dayan', 'Deluna', 'Demasi', 'Derby', 'Dey', 'Diamond', 'Dieckmann', 'Dipietro', 'Dobre', 'Doherty', 'Dolan', 'Dougherty', 'Douglas', 'Douglass', 'Doyle', 'Duffy', 'Dunbar', 'Durant', 'Eacho', 'Edwards', 'Eliassaint', 'Escobar', 'Exantus', 'Failla', 'Fakury', 'Falzone', 'Fayman', 'Feerst', 'Feinman', 'Figman', 'Fischer', 'Fisher', 'Fishkin', 'Flyer', 'Gachette', 'Galper', 'Gentile', 'Ginensky', 'Goldberg', 'Goldfarb', 'Gookin', 'Grant', 'Green', 'Greene', 'Groaner', 'Gronningsater', 'Gu', 'Hagler', 'Hannay', 'Haper', 'Heaney', 'Heinrich', 'Heyman', 'Himselson', 'Hopkirk', 'Horowitz', 'Huang', 'Hughes', 'Humbert', 'Hutchinson', 'Ierardi', 'Iheanachor', 'Illym', 'Ingelson', 'Isdokwe', 'Jafari', 'Jaffe', 'Jagielski', 'Johnson', 'Jones', 'Kean', 'Kharlamenko', 'Kishnani', 'Klengler', 'Klopfer', 'Kogan', 'Komar', 'Korek', 'Koretz', 'Kujo', 'Kurtz', 'Lane', 'Langsam', 'Laspina', 'Lerner', 'Lesher', 'Levin', 'Liben', 'Lieberman', 'Lietz', 'Liu', 'Lubin', 'Lubow', 'Lyons', 'Malhotra', 'Malone', 'Maloney', 'Manini', 'Mardirossian', 'Mariani', 'Marrero', 'Marrufo', 'Martinez', 'Mazarin', 'McDonnel', 'McGoldrick', 'McHugh', 'McNamara', 'Mease', 'Medici', 'Meehan', 'Meggett', 'Mehta', 'Mennin', 'Meyer', 'Miles', 'Millan', 'Miller', 'Mills', 'Mirabella', 'Moroney', 'Morrell', 'Morril', 'Murray', 'Musso', 'Nedich', 'Neri', 'Nicolay', 'Nolan', 'Novak', 'Novillo', 'Novis', 'Nowak', "O'Toole", 'Obus', 'Ortsman', 'Pang', 'Paolillo', 'Paple', 'Park', 'Parker', 'Pasinkoff', 'Pate', 'Pathmanathan', 'Payne', 'Peltier', 'Pemberton', 'Perbix', 'Perez', 'Perks', 'Perlin', 'Perlstein', 'Pesin', 'Pierce', 'Poole', 'Poppish', 'Quan', 'Rankin', 'Ransdell', 'Rapisarda', 'Rappaport', 'Reade', 'Redding', 'Redmond', 'Rendeiro', 'Rene', 'Rezai', 'Richman', 'Richmond', 'Ringer', 'Rivera', 'Roberts', 'Robitaille', 'Rodrigues', 'Rodriguez', 'Rosenblum', 'Ross', 'Rossman', 'Rottenberg', 'Roussel', 'Rowe', 'Rozovsky', 'Ruffin', 'Ruger', 'Ruglia', 'Rutger', 'Salters', 'Santo', 'Sattar', 'Scarcella', 'Schiavone', 'Schwartz', 'Seabrooks', 'Serette', 'Sessa', 'Shah', 'Shapovalova', 'Shin', 'Silberman', 'Silverman', 'Simchi', 'Sims', 'Slater', 'Smith', 'Sohn', 'Sorett', 'Stanziale', 'Stearn', 'Stearns', 'Stengel', 'Stephenson', 'Stevens', 'Stevenson', 'Stocking', 'Swensen', 'Swenson', 'Tian', 'Tibbets', 'Tirrell', 'Todadze', 'Toder', 'Tuccio', 'Tucker', 'Tyrell', 'Ukomedu', 'Umber', 'Umbert', 'Urena', 'Valentine', 'Vargas', 'Vasques', 'Vasquez', 'Ventura', 'Villaamil', 'Vogelman', 'Volk', 'Voshtina', 'Walker', 'Wallenstein', 'Washington', 'Weinstein', 'Weiss', 'Wellington', 'Wells', 'Williams', 'Wintle', 'Wittwer', 'Wolk', 'Wong', 'Woolworth', 'Wooten', 'Wright', 'Xe', 'Xee', 'Xi', 'Yanez', 'Yavinsky', 'Yeung', 'Yim', 'Yones', 'Young', 'Zalter', 'Zarabi']
  57. #About 319 last names.
  58.  
  59. # pick gender:
  60. # this also picks all relation language.
  61. gender = random.choice(["male","female"])
  62. if gender == "male":
  63. # all gender-specific titles here.
  64. firstname = random.choice(malenames)
  65. prefix = "Mr."
  66. manorwoman = "man"
  67. boyorgirl = "boy"
  68. pronoun = "he"
  69. thatisherdog = "his"
  70. thatshers = "his"
  71. thatshim = "him"
  72. relationtochild = "father"
  73. relationtospouse = "husband"
  74. relationtosibling = "brother"
  75. relationtoniece = "uncle"
  76. relationtograndchild = "grandfather"
  77. relationtograndfather = "grandson"
  78. relationtoaunt = "nephew"
  79. relationtofather = "son"
  80. elif gender == "female":
  81. #all gender-specific titles here.
  82. firstname = random.choice(femalenames)
  83. prefix = "Ms."
  84. manorwoman = "woman"
  85. boyorgirl = "girl"
  86. pronoun = "she"
  87. thatisherdog = "her"
  88. thatshers = "hers"
  89. thatshim = "her"
  90. relationtochild = "mother"
  91. relationtospouse = "wife"
  92. relationtosibling = "sister"
  93. relationtoniece = "aunt"
  94. relationtograndchild = "grandmother"
  95. relationtograndfather = "granddaughter"
  96. relationtoaunt = "niece"
  97. relationtofather = "daughter"
  98. else:
  99. error = "There is an error in the gender choosing code."
  100. return error
  101. pass
  102. #All non-gender specific information can go on this line.
  103. lastname = random.choice(lastnames)
  104. fullname = firstname + " " + lastname
  105.  
  106.  
  107. #Succinctly, this can be used to make a dynamic, random story. "This is " + character[1]+", "+character[7]+" is great."
  108. #MAP
  109. # 0 is gender
  110. # 1 is full name
  111. # 2 is first name
  112. # 3 is last name
  113. # 4 is prefix
  114. # 5 is man or woman
  115. # 6 is boy or girl
  116. # 7 is pronoun
  117. # 8 is thatisherdog
  118. # 9 is thatshers
  119. # 10 is thatshim
  120. # 11 is relation to a child
  121. # 12 is relation to a spouse
  122. # 13 is relation to a sibling
  123. # 14 is relation to a niece
  124. # 15 is relation to a grandchild
  125. # 16 is relation to a grandfather
  126. # 17 is relation to an aunt
  127. # 18 is relation to a father
  128. character = [gender,fullname,firstname,lastname,prefix,manorwoman,boyorgirl,pronoun,thatisherdog,thatshers,thatshim, relationtochild, relationtospouse, relationtosibling, relationtoniece, relationtograndchild, relationtograndfather,relationtoaunt,relationtofather]
  129. return character
  130.  
  131.  
  132. def createcharactertest():
  133. gary = createcharacter()
  134. print(gary)
  135. input("The test for creating a character has just been run. It should give you a character list with proper names and gender references. him/her/his/hers/he/she. Press enter to continue. ")
  136.  
  137.  
  138. # This test suite can be used to test all functions in the pack.
  139. def testsuite():
  140. choicestest()
  141. createcharactertest()
  142.  
  143. testSTPH = False
  144. if testSTPH == True:
  145. testsuite()
Add Comment
Please, Sign In to add comment