#!/usr/bin/python """ Wuxia_Name.py Silly nickname generator, in the style of _The Water Margin_. """ from cgitool import * import random TITLE_ADJECTIVES = ["Able","Arch","Bald","Bared-Teeth","Blade-Flashing","Blameless","Blazing","Bold","Bright","Brilliant","Brush-Wielding","Cautious","Claw-Struck","Clever","Curse-Breaking","Dancing","Dark","Daylight","Defiant","Dismal","Dour","Eager","Earth-Shaking","Evil","Fabulous","Far-Seeing","Fearsome","Final","First","Frantic","Free","Gallant","Gate-Crashing","Go-Along","Golden","Great","Grey","Gorge-Leaping","Gothic","Hasty","Horrible","Ice-Cutting","Iron","Iron-Forged","Itchy","Ingenious","Jade","Just","Last","Lazy","Loathsome","Mad","Marble","Marked","Masked","Meager","Mighty","Moonlight","Mysterious","Mystic","Night-Dwelling","Noble","Nosy","Ocean-Gazing","Orbital","Perilous","Perfect","Quiet","Red-Nosed","Revealed","Sand-Weighing","Sealed","Searing","Shadowy","Shining","Silent","Silver","Slippery","Smiling","Starlight","Star-Gazing","Steel","Tale-Singing","Tempestuous","Tiamat","Thunder-Crashing","Terrible","Timely","Tower-Shifting","Tuneful","Unbroken","Ungrateful","Unyielding","Vulgar","Wind-Swept","Yes-Man","Zealous"] TITLE_NOUNS = ["Abyss","Archer","Ape","Army","Axe","Banner","Bard","Bear","Blade","Boatman","Boxer","Brigand","Brush","Castle","Cat","Chef","Chain","Claw","Condor","Crane","Dawn","Dog","Eagle","Flame","Flare","Fox","Gift","Gorumand","Guardian","Herald","Horse","Islander","Jester","Judge","King","Knight","Knuckle","Lance","Lawgiver","Leaf","Lord","Lotus","Merchant","Monk","Mountain","Night","Oaf","Oath","Oblivion","Orb","Orchid","Overlord","Path","Pen","Pig","Planet","Plume","Prince","Rain","Rake","Ray","River","Rose","Sage","Scion","Scroll","Servant","Shell","Singer","Song","Skunk","Spear","Squire","Star","Stone","Storm","Strategist","Stream","Sword","Thorn","Thunder","Tide","Tiger","Trader","Tree","Typhoon","Unicorn","Vengeance","Vixen","Volcano","Wanderer","Whirlwind","Warlord","Watcher","Way","Whirlwind","Wave","Wind","Wolf","Word"] TITLE_VERBS = ["Accept","Command","Count","Create","Destroy","Divide","Fling","Harrow","Mark","Number","Regard","Paint","Praise","Rebuke","Reject","Reveal","Shake","Strike","Topple","Welcome"] def RandomTitle(): """Return an interesting title for someone.""" title = "" if random.randint(0,99) < 75: n = random.randint(0,len(TITLE_ADJECTIVES)-1) title += TITLE_ADJECTIVES[n] if (not title) or (random.randint(0,99) < 75): if title: title += " " n = random.randint(0,len(TITLE_NOUNS)-1) title += TITLE_NOUNS[n] return title def RandomStance(): """A silly fighting stance.""" stance = "" if random.randint(0,99) < 75: n = random.randint(0,len(TITLE_ADJECTIVES)-1) stance += TITLE_ADJECTIVES[n] if (not stance) or (random.randint(0,99) < 75): if stance: stance += " " n = random.randint(0,len(TITLE_NOUNS)-1) stance += TITLE_NOUNS[n] if (len(stance) < 10) or random.randint(0,99) < 50: stance += " " stance += TITLE_VERBS[random.randint(0,len(TITLE_VERBS)-1)] if stance[-1] == "e": stance = stance[:-1] stance += "ing the " stance += TITLE_NOUNS[random.randint(0,len(TITLE_NOUNS)-1)] return stance text = "
\n" text += "
Your Wuxia Nicknames:
\n" text += "
\n" NAME = Get( "name", "Grignr" ) ## Random content. random.seed( NAME ) for n in range(5): text += "-" + NAME + " the " + RandomTitle() r = random.randint(0,99) if r < 20: text += ", Master of the "+RandomStance()+" Stance
\n" elif r < 35: text += ", Follower of the "+RandomStance()+" Way
\n" elif r < 50: text += ", Student of the "+RandomStance()+" School
\n" else: text += "
\n" text += '

Enter your name to learn your own Wuxia Nicknames!
' MakeWebPage( text, title="Wuxia Title Generator", bgcolor="#FFFFFF", text="#000000" )