Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- haiku {
- const haikus = [
- '"a month of practice / earns no sub-hour / lifetime Metroid love" -dekynff',
- '"summer query time / people who play sitting down / what even is that" -dekynff',
- '"she hunts what bounty / through forgotten waters / one hundred items" -dekynff',
- '"facing great evil / the elegant princess throws / seasonal veggie" -dekynff',
- '"wither springball; yet / as summer fades to autumn / cannot skip spazer" -dekynff',
- '"Screen For Be Right Back / Crusty Did Not Give Haiku / Placeholder Haiku" -JustNotAFox',
- 'Crateria "her gunship lands cold / she armored hero heads west / lonesome she will fight."',
- '(dream) "Thunder as you wake, / weather as I fall asleep / morning ritual."',
- '(dream) "The stars align and / everything else is a lie / come waning crescent."',
- '"the fallen princess / how quickly does she escape / it was all a dream" - dekynff and CrustaceanSeven',
- 'Maridia "meet me on main street / green rocked conjuring super / drops, ominous seas."',
- 'Tourian "nerves lock at golden / four, the mechanical life / vein awaits encased."',
- 'Escape "three minutes, and the / animals are dead. behe / spark to safer space."',
- 'Metroid "hatchling, her mission / to save--so sacrificed to / she, the new mother."',
- '(dream) "Two shoremen dance in / the distance, angrily calm / immersed in attack."',
- 'Reset "judging by these frames / already lost before kraid, / stress looms imminent."',
- 'ifb "to skip saves in a / race against the backdrop of / time loss, entices."',
- '(maybe) "we were never meant / to understand why moons cast / light on their captives."',
- '"spinning Samus and / floating Princess fly through air / nothing can stop them" -InsaneFirebat',
- 'Crystal "defensive, lucent / golden girl seeks cannon and / shovel paired with lust."',
- 'Steroids "virile dual-wielder / dog earing pages before / downing a mad dog."',
- 'wardrinker "sleeps nude in an oxygen / tent that he believes / gives him sexual powers!"',
- '"softly, even as / cleaning up brinstar, / sounds of etecoon laughter" -dekynff',
- '"gt, hundo, wart / C7s joy shared, each year / memorial day" -dekynff',
- '"into nothingness / woe, her mockball power spent / kojakt before kraid" -dekynff',
- '"The pixels deceive / Chip away at my sanity / Crustacean Seven" -Sephynomy',
- '"CrustaceanSeven / Best known for playing upright / She will not reset" -Uphier',
- '"Crustys favorite / The most out of character / Justin Bailey Suit" -GallopingConch',
- '"winter treats for all! / alas, our tasty turnips / prove unloved by Wart!" -dekynff',
- '"if something goes wrong / anything from big to small / pillows and foxes" -hokkaidoubare',
- '"This is a haiku / What is a haiku really? / Haiku is haiku" -Freyguy55',
- '"Haikus can be fun / but sometimes they dont make sense / refrigerator" -stovetop1321',
- '"Kraid is bad for prom / He throws his nails everywhere / his breath smells so bad" -Choccy_Soup',
- '"you always ask me / to provide you with haikus / why not make your own?" -FUNtoon',
- '"Bomb Torizo stands / Again a pixel triumphs / claws strike only air" -EXAKTScience_'
- ]
- function getHaiku() {
- output = @haikus[random.randInt(0, len(@haikus)-1)]
- return output
- }
- }
- slots {
- const num_reels = 5
- const slot1 = {
- 'Cacatac' : {
- 'odds': [1, 50],
- 'payout': 10,
- 'symbol': '🌵'
- },
- 'Zebbo' : {
- 'odds': [1, 50],
- 'payout': 10,
- 'symbol': 'ðŸ'
- },
- 'Zero' : {
- 'odds': [1, 50],
- 'payout': 10,
- 'symbol': 'ðŸ›'
- },
- 'Reo' : {
- 'odds': [1, 50],
- 'payout': 10,
- 'symbol': '🦋'
- },
- 'Rinka' : {
- 'odds': [1, 100],
- 'payout': 20,
- 'symbol': 'â•'
- },
- 'Crocomire' : {
- 'odds': [1, 500],
- 'payout': 100,
- 'symbol': 'ðŸŠ'
- },
- 'Botwoon' : {
- 'odds': [1, 500],
- 'payout': 100,
- 'symbol': 'ðŸ'
- },
- 'Ridley' : {
- 'odds': [1, 1000],
- 'payout': 200,
- 'symbol': 'ðŸ²'
- },
- 'MotherBrain' : {
- 'odds': [1, 1000],
- 'payout': 200,
- 'symbol': '🧠'
- },
- 'Phantoon' : {
- 'odds': [1, 2500],
- 'payout': 500,
- 'symbol': '👻'
- },
- 'Climb' : {
- 'odds': [1, 5000],
- 'payout': 1000,
- 'symbol': '🧗',
- 'num_allowed_in_losing_reel': 0
- },
- 'Any1Climb' : {
- 'odds': [1, 50],
- 'payout': 10,
- 'symbol': '🧗',
- 'num_allowed_in_losing_reel': 0,
- 'max_display_in_win': 1
- },
- 'Any2Climb' : {
- 'odds': [1, 250],
- 'payout': 50,
- 'symbol': '🧗',
- 'num_allowed_in_losing_reel': 0,
- 'max_display_in_win': 2
- }
- }
- function build_symbol_list_and_weights(symbols_and_payouts) {
- denominators = []
- for (k, v in symbols_and_payouts) {
- for (n, d in symbols_and_payouts[k]['odds']) {
- denominators.append(d)
- }
- }
- denominator = math.lcm(denominators)
- v = denominator
- out_keys = []
- out_weights = []
- out_losing_symbol_list = []
- for (k, i in symbols_and_payouts) {
- var [n, d] = symbols_and_payouts[k]['odds']
- w = math.int(denominator / d) * n
- v -= w
- out_keys.append(k)
- out_weights.append(w / denominator)
- out_losing_symbol_list = out_losing_symbol_list + [symbols_and_payouts[k]['symbol']]*symbols_and_payouts[k].get('num_allowed_in_losing_reel', @num_reels-1)
- }
- out_keys.append(null)
- out_weights.append(v/denominator)
- return { 'slot': symbols_and_payouts, 'keys': out_keys, 'weights': out_weights, 'losing_symbols': out_losing_symbol_list }
- }
- const default_slot_machine = 'slot1'
- const slot_machines = {
- 'slot1': @build_symbol_list_and_weights(@slot1)
- }
- function shuffleList(in_list) {
- for (i in range(len(in_list))) {
- in_list[i] = in_list[random.randInt(0, len(in_list)-1)]
- }
- return in_list
- }
- function runSlot(slot_type: input) {
- slot_machine = (@slot_machines).get(slot_type, null)
- if (not slot_machine) {
- slot_machine = @slot_machines[@default_slot_machine]
- }
- outcome = slot_machine['keys'].choose(slot_machine['weights'])
- if (not outcome) {
- # generate an invalid (non-winning) result here....
- output = ' '.join(slot_machine['losing_symbols'].choose(k:@num_reels))
- }
- else {
- win_disp_amt = slot_machine['slot'][outcome].get('max_display_in_win', @num_reels)
- disp = [slot_machine['slot'][outcome]['symbol']]*win_disp_amt
- extra_symbols_needed = @num_reels - win_disp_amt
- if (extra_symbols_needed > 0) {
- disp.extend(slot_machine['losing_symbols'].filter($(sym) => sym and not (sym == slot_machine['slot'][outcome]['symbol'])).choose(k:extra_symbols_needed))
- }
- output = ' '.join(disp.shuffle()) + " - you won %d points!" % [slot_machine['slot'][outcome]['payout']]
- }
- return output
- }
- }
Add Comment
Please, Sign In to add comment