online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
import random def underscore_to_space(s): return s.replace('_', ' ') with open('races.txt') as f: races = [line.replace('\n', '') for line in f] with open('standard-classes.txt') as f: classes = [line.replace('\n', '') for line in f] with open('skyrim-classes.txt') as f: factions = f.readline().split(', ') factions[-1] = factions[-1][:-1] sk_classes = [] sk_faction_weights = [] sk_race_weights = [] for line in f: l = line.split(' | ') sk_classes.append(l[0].replace('\n', '')) sk_faction_weights.append([int(n)for n in l[1].split()]) sk_race_weights.append([int(n)for n in l[2].split()]) choice = input("Введи '1' для ролла расы и класса из Морровинда/Oбливиона, или '2' для расы, класса и квестовой линейки из Скайрима. ") sex = random.choice(('Male', 'Female')) print() if choice == '1': race = random.choice(races) class_name = random.choice(classes) print(sex, race, class_name, '\n') elif choice == '2': random_class_index = random.randrange(0, len(sk_classes)) _class = tuple(map(underscore_to_space, sk_classes[random_class_index].split())) class_name, class_skills = _class[0], _class[1:] races_weighted = dict(zip(races, [n+1 for n in sk_race_weights[random_class_index]])) races_choicelist = [] for race in races_weighted: races_choicelist += [race] * races_weighted[race] race = random.choice(races_choicelist) print(sex, race, class_name) print(*class_skills, sep=', ') factions_weighted = {} for i in range(len(factions)): factions_weighted.update({factions[i] : sk_faction_weights[random_class_index][i]-1}) if 'Elf' in race or race in ('Khajiit', 'Argonian'): factions_weighted['Stormcloaks'] = 1 factions_choicelist = [] for faction in factions_weighted: factions_choicelist += [faction] * factions_weighted[faction] print(random.choice(factions_choicelist), '\n') else: print("\nТы долбоёб?\n")
Argonian Breton Dark Elf High Elf Imperial Khajiit Nord Orc Redguard Wood Elf
Acrobat Agent Archer Assassin Barbarian Bard Battlemage Crusader Healer Knight Mage Monk Nightblade Pilgrim Rogue Scout Sorcerer Spellsword Thief Warrior Witchhunter
Main Quest, Companions, Thieves Guild, Dark Brotherhood, College of Winterhold, Dawnguard (Vampires side), Dawnguard (Dawnguard side), Imperial Legion, Stormcloaks Agent Speechcraft Sneak Illusion Lockpicking Marksman | 2 1 5 4 2 5 2 4 2 | 2 4 3 3 5 3 2 1 4 4 Archer Marksman Light_Armor Sneak Smithing | 4 3 3 3 1 2 5 4 4 | 4 3 3 3 4 4 4 3 4 5 Assassin Sneak One-handed Marksman Alchemy Light_Armor | 2 1 3 5 1 5 3 2 1 | 5 4 5 2 4 5 3 2 4 5 Barbarian Two-handed Light_Armor Smithing Block Marksman | 5 5 2 2 1 2 4 3 5 | 4 2 3 2 2 4 5 4 4 3 Barbarian_(Dual-wield) One-handed Light_Armor Smithing Marksman | 5 5 3 3 1 2 4 3 5 | 5 2 3 2 2 5 4 3 5 4 Ranger Marksman One-handed Block Alchemy Light_Armor Sneak | 5 4 3 3 1 3 5 4 5 | 5 2 3 2 3 4 5 3 5 5 Bard Speechcraft Block One-handed Illusion Alteration | 2 3 3 2 2 3 2 4 4 | 2 5 3 3 5 2 5 1 4 3 Battlemage Destruction Conjuration Alteration One-handed Restoration | 4 2 1 3 5 4 4 5 3 | 4 5 5 5 3 2 3 2 2 3 Battlemage_(Heavy_Armor) Destruction Conjuration Heavy_Armor One-handed Restoration | 4 2 1 3 5 4 4 5 3 | 3 5 5 3 5 2 2 3 2 2 Crusader_(One-handed) One-handed Block Heavy_Armor Restoration Destruction | 5 5 1 2 3 2 5 5 4 | 2 5 5 3 5 2 3 2 4 2 Crusader_(Two-handed) Two-handed Heavy_Armor Restoration Destruction Block | 5 5 1 2 3 2 5 5 4 | 2 4 5 2 4 2 4 3 3 2 Armorer Smithing Enchantment Speech Heavy_Armor One-handed Block Marksman | 4 3 3 3 2 3 4 4 3 | 4 4 3 3 4 2 4 5 4 2 Healer Restoration Alteration Illusion Alchemy One-handed Block | 2 1 1 1 4 2 3 5 5 | 5 4 2 4 4 2 3 2 3 3 Mystic Illusion Alteration Conjuration Marksman One-handed Restoration | 3 2 2 4 5 4 3 4 2 | 5 5 5 4 4 4 3 2 3 5 Knight Two-handed Block Heavy_Armor Speechcraft Restoration | 5 5 1 2 1 3 4 5 5 | 2 4 4 4 5 2 3 2 4 2 Mage Destruction Alteration Conjuration Restoration Illusion Alchemy Enchantment | 4 1 1 3 5 4 4 4 2 | 4 5 4 5 4 2 3 2 3 3 Vigilant Block One-handed Alteration Restoration | 3 3 1 2 3 3 5 4 3 | 3 4 3 3 5 2 4 2 4 2 Nightblade Sneak Illusion One-handed Destruction Alteration Light_Armor | 3 2 3 5 4 5 4 5 2 | 5 4 5 3 4 3 3 2 3 4 Pilgrim One-handed Block Light_Armor Speechcraft Alteration Marksman | 5 3 4 3 1 4 4 4 4 | 3 4 4 2 5 4 5 2 5 3 Rogue One-handed Block Light_Armor Marksman Speechcraft | 3 3 5 4 1 3 4 4 4 | 3 3 4 2 5 5 4 3 5 4 Scout Light_Armor One-handed Block Marksman Alchemy Sneak | 4 3 4 3 1 3 5 5 5 | 5 2 4 2 4 5 3 2 3 5 Sorcerer Conjuration Enchantment Heavy_Armor Block One-handed Destruction | 5 2 1 3 5 5 4 4 2 | 3 5 5 4 5 2 2 3 2 2 Spellsword One-handed Destruction Heavy_Armor Alteration Illusion | 5 3 2 3 4 3 4 4 3 | 4 5 4 3 5 3 4 3 3 2 Thief Sneak Pickpocket Lockpicking Speechcraft Alchemy Light_Armor One-handed | 2 1 5 2 1 2 1 1 1 | 4 3 4 2 5 5 4 3 5 5 Burglar Sneak Lockpicking Pickpocket Illusion Alteration Speechcraft | 2 1 5 2 2 3 1 1 1 | 5 3 4 3 5 4 3 2 4 5 Warrior Heavy_Armor Two-handed Smithing Block Marksman | 5 5 2 2 1 3 4 5 5 | 2 2 3 2 4 3 4 5 4 3 Warrior Heavy_Armor One-handed Block Smithing Marksman | 5 5 2 2 1 3 4 5 5 | 2 2 3 2 4 3 4 5 4 3 Witchhunter Marksman Conjuration Enchantment One-handed Alchemy Light_Armor Sneak | 4 3 1 3 2 4 5 3 2 | 5 4 5 3 4 3 3 3 3 5 Witchblade One-handed Destruction Block Illusion Restoration Light_Armor | 3 3 2 4 3 5 4 3 2 | 5 5 5 4 4 3 3 3 4 3

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue