import random user_first_name = str() user_last_name = str() user_tribe = str() user_weapon = str() user_shield = str() user_armor = str() user_damage = str() user_health = int() user_skill_points = int() user_religion = str() user_age = int() user_weight = int() user_height = int() user_familiar = str() races = ["Dwarf", "Elf", "Halfling", "Human"] classes = ["Barbarian", "Bard", "Cleric", "Druid", "Fighter", "Mage", "Monk", "Paladin", "Ranger", "Sorcerer", "Rogue"] alignment1 = ["Lawful", "Neutral", "Chaotic"] alignment2 = ["Good", "Neutral", "Evil"] melee_weapons = ["Club", "Dagger", "Javelin", "Light Mace", "Mace", "Short Spear", "Sickle", "Spear", "Spiked Gauntlet", "Great Club", "Morning Star", "Quarterstaff", "Scythe"] ranged_weapons = ["Dejada", "Hand Crossbow", "Sling", "Crossbow", "Repeating Crossbow"] fighter_religions = ["Heironeous", "Kord", "St. Cuthbert", "Hextor", "Erythnul"] druid_weapons = ["Club", "Dagger", "Dart", " Quarterstaff", "Scimitar", "Sickle", "Shortspear", "Sling", "Spear"] druid_armor = ["Padded", "Leather", "Hide"] bard_weapons = ["Longsword", "Rapier", "Sap", "Short Sword", "Shortbow", "Whip", "Dagger", "Gauntlet", "LightMace", "Sickle", "Club", "Mace", "Morningstar", "Shortspear", "Longspear", "Quarterstaff", "Spear", "Crossbow", "LightCrossbow", "Dart", "Javelin", "Sling"] bard_armor = ["Padded", "Leather", "Studded Leather", "Chain shirt"] cleric_armor = ["Padded", "Leather", "Studded Leather", "Hide", "Chain Shirt", "Scalemail", "Chainmail", "Breastplate", "Splintmail", "Bandedmail", "Half Plate", "Full Plate"] barbarian_armor = ["Padded Leather", "Studded Leather", "Chainshirt", "Hide", "Scalemail", "Chainmail", "Breastplate"] shields = ["Light Wooden", "Light Steel", "Heavy Wooden", "Heavy Steel", "Buckler"] religions = ["Heironeous", "Moradin", "Yondalla", "Ehlonna", "Garl Glittergold", "Pelor", "Corellon Larethian", "Kord", "Wee Jas", "St. Cuthbert", "Boccob", "Fharlanghn", "Obad-Hai", "Olidammara", "Hextor", "Nerull", "Vecna", "Erythnul", "Gruumsh"] armor = ["Padded", "Leather", "Studded Leather", "Chain Shirt", "Hide", "Scalemail", "Chainmail", "Breastplate", "Splintmail", "Bandedmail", "Half Plate", "Full Plate"] monk_religions = ["Heironeous", "St. Cuthbert", "Hextor"] monk_weapons = ["Club", "Light Crossbow", "Heavy Crossbow", "Dagger", "Dandaxe", "Javelin", "Kama", "Nunchaku", "Quarterstaff", "Sai", "Shuriken", "Siangham", "Sling"] rogue_weapons = ["Sap", "Shortbow", "Rapier", "Short Sword", "Club", "Dagger", "Javelin", "Light Mace", "Mace", "Short Spear", "Sickle", "Spear", "Spiked Gauntlet", "Great Club", "Morning Star", "Quarterstaff", "Scythe", "Dejada", "Hand Crossbow", "Sling", "Crossbow", "Repeating Crossbow"] wizard_weapons = ["Club", "Dagger", "Heavy Crossbow", "Light Crossbow", "Quarterstaff"] familiars = ["Bat", "Cat", "Hawk", "Lizard", "Owl", "Rat", "Raven", "Snake", "Toad", "Weasel"] dwarf_first_names = ["Adrik", "Alberich", "Baern", "Barendd", "Brottor", "Bruenor", "Dain", "Darrak", "Delg", "Eberk", "Einkil", "Fargrim", "Flint", "Gardain", "Harbek", "Kildrak", "Morgran", "Orsik" ,"Oskar", "Rangrim", "Rurik", "Taklinn", "Thoradin", "Thorin", "Tordek", "Traubon", "Travok", "Ulfgar", "Veit", "Vondal"] dwarf_last_names = ["Balderk", "Battlehammer", "Brawnanvil", "Dankil", "Fireforge", "Frostbeard", "Gorunn", "Holderhek", "Ironfist", "Loderr", "Lutgehr", "Rumnaheim", "Strakeln", "Torunn", "Ungart"] elf_first_names = ["Adran", "Aelar", "Aramil", "Arannis", "Aust", "Beiro", "Berrian", "Carric", "Enialis", "Erdan", "Erevan", "Galinndan", "Hadarai", "Heian", "Himo", "Immeral", "Ivellios", "Laucian", "Mindartis", "Paelias", "Peren", "Quarion", "Riardon", "Rolen", "Soveliss", "Thamior", "Tharivol", "Theren", "Varis"] elf_last_names = ["Amakiir", "Amastacia", "Galanodel", "Holimion", "Ilphelkiir", "Liadon", "Meliamne", "Naïlo", "Siannodel", "Xiloscient"] halfling_first_names = ["Alton", "Ander", "Cade", "Corrin", "Eldon", "Errich", "Finnan", "Garret", "Lindal", "Lyle", "Merric", "Milo", "Osborn", "Perrin", "Reed", "Roscoe", "Wellby"] halfling_last_names = ["Brushgather", "Goodbarrel", "Greenbottle", "High-hill", "Hilltopple", "Leagallow", "Tealeaf", "Thorngage", "Tosscobble", "Underbough"] human_first_names_calishite = ["Aseir", "Bardeid", "Haseid", "Khemed", "Mehmen", "Sudeiman", "Zasheir"] human_last_names_calishite = ["Basha", "Dumein", "Jassan", "Khalid", "Mostana", "Pashar", "Rein"] human_first_names_chondathan = ["Darvin", "Dorn", "Evendur", "Gorstag", "Grim", "Helm", "Malark", "Morn", "Randal", "Stedd"] human_last_names_chondathan = ["Amblecrown", "Buckman", "Dundragon", "Evenwood", "Greycastle", "Tallstag"] human_first_names_damaran = ["Bor", "Fodel", "Glar", "Grigor", "Igan", "Ivor", "Kosef", "Mival", "Orel", "Pavel", "Sergor"] human_last_names_damaran = ["Bersk", "Chernin", "Dotsk", "Kulenov", "Marsk", "Nemetsk", "Shemov", "Starag"] human_first_names_illuskan = ["Ander", "Blath", "Bran", "Frath", "Geth", "Lander", "Luth", "Malcer", "Stor", "Taman", "Urth"] human_last_names_illuskan = ["Brightwood", "Helder", "Hornraven", "Lackman", "Stormwind", "Windrivver"] human_first_names_mulan = ["Aoth", "Bareris", "Ehput-Ki", "Kethoth", "Mumed", "Ramas", "So-Kehur", "Thazar-De", "Urhur"] human_last_names_mulan = ["Ankhalab", "Anskuld", "Fezim", "Hahpet", "Nathandem", "Sepret", "Uuthrakt"] human_first_names_rashemi = ["Borivik", "Faurgar", "Jandar", "Kanithar", "Madislak", "Ralmevik", "Shaumar", "Vladislak"] human_last_names_rashemi = ["Ankhalab", "Anskuld", "Fezim", "Hahpet", "Nathandem", "Sepret", "Uuthrakt"] human_first_names_shou = ["Chien", "Huang", "Kao", "Kung", "Lao", "Ling", "Mei", "Pin", "Shin", "Sum", "Tan", "Wan"] human_last_names_shou = ["An", "Chen", "Chi", "Fai", "Jiang", "Jun", "Lian", "Long", "Meng", "On", "Shan", "Shui", "Wen"] human_first_names_turami = ["Anton", "Diero", "Marcon", "Pieron", "Rimardo", "Romero", "Salazar", "Umbero"] human_last_names_turami = ["Agosto", "Astorio", "Calabra", "Domine", "Falone", "Marivaldi", "Pisacar", "Ramondo"] human_tribes = ["Calishite", "Chondathan", "Damaran", "Illuskan", "Mulan", "Rashemi", "Shou", "Turami"] strength = random.randrange(8,18) dexterity = random.randrange(8,18) constitution = random.randrange(8,18) intelligence = random.randrange(8,18) wisdom = random.randrange(8,18) charisma = random.randrange(8,18) user_align = random.choice(alignment1) + " " + random.choice(alignment2) user_race = random.choice(races) user_class = random.choice(classes) if(user_race == "Dwarf"): user_first_name = random.choice(dwarf_first_names) user_last_name = random.choice(dwarf_last_names) if(random.random() > 0.8): user_religion = "Moradin" user_age = random.randrange(40,140) user_height = random.randrange(48,56) user_weight = 130 + (user_height-57)*random.randrange(2,12) constitution = constitution + 2 charisma = charisma - 2 elif(user_race == "Elf"): user_first_name = random.choice(elf_first_names) user_last_name = random.choice(elf_last_names) user_religion = "Corellon Larethian" user_age = random.randrange(110,180) user_height = random.randrange(55,65) user_weight = 85 + (user_height-52)*random.randrange(1,6) dexterity = dexterity + 2 constitution = constitution - 2 elif(user_race == "Halfling"): user_first_name = random.choice(halfling_first_names) user_last_name = random.choice(halfling_last_names) if(random.randrange(0,3) > 0): user_align = "Neutral " + random.choice(alignment2) user_age = random.randrange(22,30) user_weight = random.randrange(30,32) user_height = random.randrange(34,40) dexterity = dexterity + 2 strength = strength - 2 else: user_tribe = random.choice(human_tribes) user_age = random.randrange(18,30) user_height = random.randrange(60,80) user_weight = 120 + (user_height-58)*random.randrange(2,8) if(user_tribe == "Calishite"): user_first_name = random.choice(human_first_names_calishite) user_last_name = random.choice(human_last_names_calishite) elif(user_tribe == "Chondathan"): user_first_name = random.choice(human_first_names_chondathan) user_last_name = random.choice(human_last_names_chondathan) elif(user_tribe == "Damaran"): user_first_name = random.choice(human_first_names_damaran) user_last_name = random.choice(human_last_names_damaran) elif(user_tribe == "Illuskan"): user_first_name = random.choice(human_first_names_illuskan) user_last_name = random.choice(human_last_names_illuskan) elif(user_tribe == "Mulan"): user_first_name = random.choice(human_first_names_mulan) user_last_name = random.choice(human_last_names_mulan) elif(user_tribe == "Rashemi"): user_first_name = random.choice(human_first_names_rashemi) user_last_name = random.choice(human_last_names_rashemi) elif(user_tribe == "Shou"): user_first_name = random.choice(human_first_names_shou) user_last_name = random.choice(human_last_names_shou) else: user_first_name = random.choice(human_first_names_turami) user_last_name = random.choice(human_last_names_turami) user_last_name = user_last_name + ", of the clan " + user_tribe if(user_class == "Barbarian"): user_skill_points = 4+(intelligence-10) / 2*4 user_health = 12 + (constitution-10) / 2 user_weapon = random.choice(melee_weapons) user_shield = random.choice(shields) user_armor = random.choice(barbarian_armor) user_align = alignment1[random.randrange(1,3)] + " " + random.choice(alignment2) if(random.random() > 0.3): user_religion = "Kord" if(random.random() > 0.6): user_religion = "Obad-Hai" if(random.random() > 0.9): user_religion = "Erythnul" elif(user_class == "Bard"): user_skill_points = (6+(intelligence-10) / 2) * 4 user_health = ((constitution-10) / 2) + 12 user_weapon = random.choice(bard_weapons) user_shield = shields[random.randrange(0,3)] user_armor = random.choice(bard_armor) user_align = alignment1[random.randrange(1,3)] + " " + random.choice(alignment2) if("chaotic" in user_align): user_religion = "Olidammara" elif(random.random() > 0.5): user_religion = "Pelor" elif(random.random() > 0.5): user_religion = "Corellon Larethian" elif(user_class == "Cleric"): user_health = 8 + (constitution-10) / 2 user_skill_points = (2 + (intelligence-10) / 2) * 4 if(random.random() > 0.5): user_weapon = random.choice(melee_weapons) else: user_weapon = random.choice(ranged_weapons) user_armor = random.choice(cleric_armor) user_shield = random.choice(shields) user_religion = random.choice(religions) elif(user_class == "Druid"): user_health = 8 + (constitution-10) / 2 if(random.random() > 0.5): user_shield = "Light Wooden Shield" else: user_shield = "Heavy Wooden Shield" user_weapon = random.choice(druid_weapons) user_armor = random.choice(druid_armor) user_skill_points = (4 + (intelligence-10) / 2) * 4 if(random.random() >0.8): if(random.random() > 0.5): user_religion = user_religion + "Obad-Hai" else: user_religion = user_religion + "Ehlonna" while(user_align == "Chaotic Good" or user_align == "Chaotic Evil" or user_align == "Lawful Good" or user_align == "Lawful Evil"): user_align = random.choice(alignment1) + " " + random.choice(alignment2) elif(user_class == "Fighter"): user_health = 10 + (constitution-10) / 2 user_skill_points = (2 + (intelligence-10) / 2) * 4 if(random.random() > 0.5): user_weapon = random.choice(melee_weapons) else: user_weapon = random.choice(ranged_weapons) user_shield = random.choice(shields) user_armor = random.choice(armor) user_religion = random.choice(fighter_religions) elif(user_class == "Monk"): user_health = 8 + (constitution-10) / 2 user_skill_points = (4 + (intelligence-10) / 2) * 4 if(random.random() > 0.8): user_armor = armor[random.randrange(0,3)] if(random.random() > 0.8): user_shield = shields[random.randrange(0,3)] user_weapon = random.choice(monk_weapons) user_align = "Lawful " + random.choice(alignment2) if(random.random() > 0.4): user_religion = random.choice(monk_religions) else: user_religion = random.choice(religions) elif(user_class == "Paladin"): user_health = 10 + (constitution-10) / 2 user_skill_points = (2 + (intelligence-10) / 2) * 4 user_armor = random.choice(armor) user_shield = random.choice(shields) if(random.random() > 0.5): user_weapon = random.choice(melee_weapons) else: user_weapon = random.choice(melee_weapons) user_align = "Lawful Good" if(random.random() > 0.7): user_religion = "Heironeous" elif(random.random() > 0.6): user_religion = "Pelor" elif(user_class == "Ranger"): user_health = 6 + (constitution-10) / 2 user_skill_points = (6+(intelligence-10) / 2) * 4 user_armor = armor[random.randrange(0,3)] user_shield = shields[random.randrange(0,3)] user_weapon = random.choice(ranged_weapons) if(random.random() > 0.7): if(random.random() > 0.5): user_religion = "Ehlonna" else: user_religion = "Obad Hai" else: user_religion = random.choice(religions) if(user_skill_points < 4): user_skill_points = 4 elif(user_class == "Rogue"): user_health = 6 + (constitution-10) / 2 user_skill_points = (8 + (intelligence-10) / 2) * 4 user_armor = armor[random.randrange(0,3)] user_weapon = random.choice(rogue_weapons) user_religion = random.choice(relgions) elif(user_class == "Sorcerer"): user_health = 4 + (constitution-10) / 2 user_skill_points = (2 + (intelligence-10) / 2) * 4 if(random.random() > 0.5): user_weapon = random.choice(ranged_weapons) else: user_weapon = random.choice(melee_weapons) if(random.random() > 0.5): user_religion = random.range(relgions) user_familiar = random.choice(familiars) if(user_familiar == "Toad"): user_health = 7 + (constitution-10) / 2 elif(user_class == "Wizard"): user_health = 4 + (constitution-10) / 2 user_skill_points = (2 + (intelligence-10) / 2) * 4 user_weapon = random.choice(wizard_weapons) if(math.random > 0.6): user_religion = "Boccob" if("evil" in user_align and random.random() > 0.3): user_religion = "Nerull" if(user_align == "Neutral Neutral"): user_align = "True Neutral" print ("Name: "+ user_first_name + " "+ user_last_name) print ("Age: " + str(user_age) + "\n") print ("Character Type: "+ user_race + " " + user_class) print ("Alignment: " + user_align + "\n") print ("Weapon: " + user_weapon) if (user_armor != ""): print ("Armor: " + user_armor + " Armor") if (user_weapon != "Great Club" and user_weapon != "Morning Star" and user_weapon != "Quarterstaff" and user_weapon != "Scythe" and user_shield != ""): print ("Shield: " + user_shield + " Shield") print ("\nStrength: "+ str(strength) + " ("+ str((strength-10) / 2) + ")") print ("Dexterity: "+ str(dexterity)+ " ("+ str((dexterity-10) / 2) + ")") print ("Constitution: "+ str(constitution)+ " ("+ str((constitution-10) / 2) + ")") print ("Intelligence: "+ str(intelligence)+ " ("+ str((intelligence-10) / 2) + ")") print ("Wisdom: "+ str(wisdom)+ " ("+ str((wisdom-10) / 2) + ")") print ("Charisma: "+ str(charisma)+ " ("+ str((charisma-10) / 2) + ")") print ("\nSkill Points: " + str(user_skill_points)) print ("Height: " + str(user_height/12) + "'"+ str(user_height % 12) + " Weight: " + str(user_weight) + " lbs.") if (user_religion != ""): print ("Religion: " + user_religion)
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question