SHOW:
|
|
- or go back to the newest paste.
1 | haiku { | |
2 | ||
3 | const haikus = [ | |
4 | '"a month of practice / earns no sub-hour / lifetime Metroid love" -dekynff', | |
5 | '"summer query time / people who play sitting down / what even is that" -dekynff', | |
6 | '"she hunts what bounty / through forgotten waters / one hundred items" -dekynff', | |
7 | - | '"facing great evil / the elegant princess throws / seasonal veggies" -dekynff', |
7 | + | '"facing great evil / the elegant princess throws / seasonal veggie" -dekynff', |
8 | '"wither springball; yet / as summer fades to autumn / cannot skip spazer" -dekynff', | |
9 | '"Screen For Be Right Back / Crusty Did Not Give Haiku / Placeholder Haiku" -JustNotAFox', | |
10 | 'Crateria "her gunship lands cold / she armored hero heads west / lonesome she will fight."', | |
11 | '(dream) "Thunder as you wake, / weather as I fall asleep / morning ritual."', | |
12 | '(dream) "The stars align and / everything else is a lie / come waning crescent."', | |
13 | '"the fallen princess / how quickly does she escape / it was all a dream" - dekynff and CrustaceanSeven', | |
14 | 'Maridia "meet me on main street / green rocked conjuring super / drops, ominous seas."', | |
15 | 'Tourian "nerves lock at golden / four, the mechanical life / vein awaits encased."', | |
16 | 'Escape "three minutes, and the / animals are dead. behe / spark to safer space."', | |
17 | 'Metroid "hatchling, her mission / to save--so sacrificed to / she, the new mother."', | |
18 | '(dream) "Two shoremen dance in / the distance, angrily calm / immersed in attack."', | |
19 | 'Reset "judging by these frames / already lost before kraid, / stress looms imminent."', | |
20 | 'ifb "to skip saves in a / race against the backdrop of / time loss, entices."', | |
21 | '(maybe) "we were never meant / to understand why moons cast / light on their captives."', | |
22 | '"spinning Samus and / floating Princess fly through air / nothing can stop them" -InsaneFirebat', | |
23 | 'Crystal "defensive, lucent / golden girl seeks cannon and / shovel paired with lust."', | |
24 | - | 'Steroids "virile dual-wielder / dog earing pages / before downing a mad dog."', |
24 | + | 'Steroids "virile dual-wielder / dog earing pages before / downing a mad dog."', |
25 | 'wardrinker "sleeps nude in an oxygen / tent that he believes / gives him sexual powers!"', | |
26 | - | '"softly, even as / cleaning up brinstar, sounds of / etecoon laughter" -dekynff', |
26 | + | '"softly, even as / cleaning up brinstar, / sounds of etecoon laughter" -dekynff', |
27 | '"gt, hundo, wart / C7s joy shared, each year / memorial day" -dekynff', | |
28 | '"into nothingness / woe, her mockball power spent / kojakt before kraid" -dekynff', | |
29 | '"The pixels deceive / Chip away at my sanity / Crustacean Seven" -Sephynomy', | |
30 | '"CrustaceanSeven / Best known for playing upright / She will not reset" -Uphier', | |
31 | '"Crustys favorite / The most out of character / Justin Bailey Suit" -GallopingConch', | |
32 | '"winter treats for all! / alas, our tasty turnips / prove unloved by Wart!" -dekynff', | |
33 | '"if something goes wrong / anything from big to small / pillows and foxes" -hokkaidoubare', | |
34 | '"This is a haiku / What is a haiku really? / Haiku is haiku" -Freyguy55', | |
35 | '"Haikus can be fun / but sometimes they dont make sense / refrigerator" -stovetop1321', | |
36 | '"Kraid is bad for prom / He throws his nails everywhere / his breath smells so bad" -Choccy_Soup', | |
37 | '"you always ask me / to provide you with haikus / why not make your own?" -FUNtoon', | |
38 | - | '"Bomb Torizo stands / Again a pixel triumphs / claws strike only air" -EXAKTScience_', |
38 | + | '"Bomb Torizo stands / Again a pixel triumphs / claws strike only air" -EXAKTScience_' |
39 | - | '"Three super missiles / Part of a balanced breakfast / tasty treats for Kraid" -EXAKTScience_', |
39 | + | |
40 | - | '"Hello there robots / get the hell out of the way / this room friggin sucks" -EXAKTScience_', |
40 | + | |
41 | - | '"exploring the caves / Samus ventures forth boldly / brinstar\'s secrets wait" -jakoliath', |
41 | + | |
42 | - | '"Crusty is damn good / Better than I\'ll ever be / Gonna PB soon" -MasterHodges', |
42 | + | |
43 | - | '"Haikus are a joke / they often sound kinda weird / I prefer Mad Libs" -MasterHodges', |
43 | + | |
44 | - | '"Just for the record / I\'ve won contests with Haikus / Yes, I\'m that damn good" -MasterHodges', |
44 | + | |
45 | - | '"No skin, no halo / Melting must survive til Throne / two HP til dead" -InsaneFirebat', |
45 | + | } |
46 | - | '"gloomy darkness looms / ghosts appear as from nothing / a wrecked ship stranded" -jakoliath', |
46 | + | |
47 | - | '"looks like a good meal / my family would approve / take my accolades" -InsaneFirebat and CrustaceanSeven', |
47 | + | slots { |
48 | - | '"can you imagine / what the world would be like if / aniv wrote haikus" -InsaneFirebat', |
48 | + | const num_reels = 5 |
49 | - | '"my eyes are burning / staring at this tv screen / why wont I just blink?" -DarkXoa', |
49 | + | const slot1 = { |
50 | - | '"spring sun\'s finally / making rocks worth looking at\, / no electric light" -hokkaidoubare', |
50 | + | 'Cacatac' : { |
51 | - | '"haikus are silly / doesn\'t take much to make one / and most of them suck" -MasterHodges', |
51 | + | 'odds': [1, 50], |
52 | - | '"bullying haikus\? / what\'s this world coming to now? / i swear\, we\'re all screwed." -MasterHodges', |
52 | + | 'payout': 10, |
53 | - | '"when i start talking / and haikus are all i say / i struggle to stop" -MasterHodges', |
53 | + | 'symbol': '🌵' |
54 | - | '"speedrunning on twitch / while chatters make up haikus / seems unfair to me" -MasterHodges', |
54 | + | }, |
55 | - | '"ok i\'m done now. / let\'s focus on a PB. / good luck C7." -MasterHodges', |
55 | + | 'Zebbo' : { |
56 | - | '"Crocomire\'s demise / Magma melts away the flesh / Crawls out to greet death" -jakoliath', |
56 | + | 'odds': [1, 50], |
57 | - | '"norfair autumn day / crocomire\'s such a cutie / obliterated" -hokkaidoubare', |
57 | + | 'payout': 10, |
58 | - | '"You don\'t like Chicken\? / Chicken is unstoppable. / Who needs a halo?" -InsaneFirebat', |
58 | + | 'symbol': 'ðŸ' |
59 | - | '"Don\'t cheat the system. / Taw worked realy hard on it. / Ceres is sacred" -InsaneFirebat', |
59 | + | }, |
60 | - | '"Ceres\, gentle star / A beacon in dark expanse / Former home of dreams" -jakoliath', |
60 | + | 'Zero' : { |
61 | - | '"haikus are back now? / that\'s just lovely\, isn\'t it? / can\'t wait to start up..." -MasterHodges', |
61 | + | 'odds': [1, 50], |
62 | - | '"those frogs are real jerks / trying to jack up your run / flatten the mofos" -MasterHodges', |
62 | + | 'payout': 10, |
63 | - | '"what is that? jello? / and running through spikes too? yikes!! / sick\, evil level..." -MasterHodges', |
63 | + | 'symbol': 'ðŸ›' |
64 | - | '"ok gotta go / more food prep for tomorrow / have fun crusty\, peace!!" -MasterHodges', |
64 | + | }, |
65 | - | '"still bounty hunting / chasing down the space pirates / speedruns never change" -InsaneFirebat' |
65 | + | 'Reo' : { |
66 | 'odds': [1, 50], | |
67 | 'payout': 10, | |
68 | 'symbol': '🦋' | |
69 | }, | |
70 | 'Rinka' : { | |
71 | 'odds': [1, 100], | |
72 | 'payout': 20, | |
73 | 'symbol': 'â•' | |
74 | }, | |
75 | 'Crocomire' : { | |
76 | 'odds': [1, 500], | |
77 | 'payout': 100, | |
78 | 'symbol': 'ðŸŠ' | |
79 | }, | |
80 | 'Botwoon' : { | |
81 | 'odds': [1, 500], | |
82 | 'payout': 100, | |
83 | 'symbol': 'ðŸ' | |
84 | }, | |
85 | 'Ridley' : { | |
86 | 'odds': [1, 1000], | |
87 | 'payout': 200, | |
88 | 'symbol': 'ðŸ²' | |
89 | }, | |
90 | 'MotherBrain' : { | |
91 | 'odds': [1, 1000], | |
92 | 'payout': 200, | |
93 | 'symbol': '🧠' | |
94 | }, | |
95 | 'Phantoon' : { | |
96 | 'odds': [1, 2500], | |
97 | 'payout': 500, | |
98 | 'symbol': '👻' | |
99 | }, | |
100 | 'Climb' : { | |
101 | 'odds': [1, 5000], | |
102 | 'payout': 1000, | |
103 | 'symbol': '🧗', | |
104 | 'num_allowed_in_losing_reel': 0 | |
105 | }, | |
106 | 'Any1Climb' : { | |
107 | 'odds': [1, 50], | |
108 | 'payout': 10, | |
109 | 'symbol': '🧗', | |
110 | 'num_allowed_in_losing_reel': 0, | |
111 | 'max_display_in_win': 1 | |
112 | }, | |
113 | 'Any2Climb' : { | |
114 | 'odds': [1, 250], | |
115 | 'payout': 50, | |
116 | 'symbol': '🧗', | |
117 | 'num_allowed_in_losing_reel': 0, | |
118 | 'max_display_in_win': 2 | |
119 | } | |
120 | } | |
121 | ||
122 | function build_symbol_list_and_weights(symbols_and_payouts) { | |
123 | denominators = [] | |
124 | for (k, v in symbols_and_payouts) { | |
125 | for (n, d in symbols_and_payouts[k]['odds']) { | |
126 | denominators.append(d) | |
127 | } | |
128 | } | |
129 | denominator = math.lcm(denominators) | |
130 | ||
131 | v = denominator | |
132 | out_keys = [] | |
133 | out_weights = [] | |
134 | out_losing_symbol_list = [] | |
135 | ||
136 | for (k, i in symbols_and_payouts) { | |
137 | var [n, d] = symbols_and_payouts[k]['odds'] | |
138 | w = math.int(denominator / d) * n | |
139 | v -= w | |
140 | ||
141 | out_keys.append(k) | |
142 | out_weights.append(w / denominator) | |
143 | 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) | |
144 | } | |
145 | ||
146 | out_keys.append(null) | |
147 | out_weights.append(v/denominator) | |
148 | ||
149 | return { 'slot': symbols_and_payouts, 'keys': out_keys, 'weights': out_weights, 'losing_symbols': out_losing_symbol_list } | |
150 | } | |
151 | ||
152 | const default_slot_machine = 'slot1' | |
153 | const slot_machines = { | |
154 | 'slot1': @build_symbol_list_and_weights(@slot1) | |
155 | } | |
156 | ||
157 | function shuffleList(in_list) { | |
158 | for (i in range(len(in_list))) { | |
159 | in_list[i] = in_list[random.randInt(0, len(in_list)-1)] | |
160 | } | |
161 | return in_list | |
162 | } | |
163 | ||
164 | function runSlot(slot_type: input) { | |
165 | slot_machine = (@slot_machines).get(slot_type, null) | |
166 | if (not slot_machine) { | |
167 | slot_machine = @slot_machines[@default_slot_machine] | |
168 | } | |
169 | ||
170 | outcome = slot_machine['keys'].choose(slot_machine['weights']) | |
171 | if (not outcome) { | |
172 | # generate an invalid (non-winning) result here.... | |
173 | output = ' '.join(slot_machine['losing_symbols'].choose(k:@num_reels)) | |
174 | } | |
175 | else { | |
176 | win_disp_amt = slot_machine['slot'][outcome].get('max_display_in_win', @num_reels) | |
177 | disp = [slot_machine['slot'][outcome]['symbol']]*win_disp_amt | |
178 | extra_symbols_needed = @num_reels - win_disp_amt | |
179 | ||
180 | if (extra_symbols_needed > 0) { | |
181 | disp.extend(slot_machine['losing_symbols'].filter($(sym) => sym and not (sym == slot_machine['slot'][outcome]['symbol'])).choose(k:extra_symbols_needed)) | |
182 | } | |
183 | ||
184 | output = ' '.join(disp.shuffle()) + " - you won %d points!" % [slot_machine['slot'][outcome]['payout']] | |
185 | } | |
186 | ||
187 | return output | |
188 | } | |
189 | } |