Created
December 27, 2012 16:59
-
-
Save petehamilton/4389864 to your computer and use it in GitHub Desktop.
A quick and dirty game of bingo, written in ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/env/ruby | |
mappings = { | |
1 => 'Kelly\'s Eye', | |
2 => 'One Little Duck', | |
3 => 'Cup of Tea', | |
4 => 'Knock at the Door', | |
5 => 'Man Alive', | |
6 => 'Tom Mix', | |
7 => 'Lucky', | |
8 => 'Garden Gate', | |
9 => 'Doctors Orders', | |
10 => 'Tony\'s Den', | |
11 => 'Legs Eleven', | |
12 => 'One Dozen', | |
13 => 'Unlucky for Some', | |
14 => 'Valentines Day', | |
15 => 'Young and Keen', | |
16 => 'Sweet Sixteen', | |
17 => 'Dancing Queen', | |
18 => 'Coming of Age', | |
19 => 'Goodbye-Teens', | |
20 => 'One Score', | |
21 => 'Key of the Door', | |
22 => 'Two Little Ducks', | |
23 => 'Three and Me', | |
24 => 'Two Dozen', | |
25 => 'Duck and Dive', | |
26 => 'Pick and Mix', | |
27 => 'Gateway to Heaven', | |
28 => 'Over Weight', | |
29 => 'Rise and Shine', | |
30 => 'Dirty Gertie', | |
31 => 'Get up and Run', | |
32 => 'Buckle my Shoe', | |
33 => 'Dirty Knee', | |
34 => 'Ask for More', | |
35 => 'Jump and Jive', | |
36 => 'Three Dozen', | |
37 => 'More than Eleven', | |
38 => 'Christmas Cake', | |
39 => 'Steps', | |
40 => 'Naughty Forty', | |
41 => 'Time for Fun', | |
42 => 'Winnie the Pooh', | |
43 => 'Down on your Knee', | |
44 => 'Droopy Drawers', | |
45 => 'Halfway There', | |
46 => 'Up to Tricks', | |
47 => 'Four and Seven', | |
48 => 'Four Dozen', | |
49 => 'PC', | |
50 => 'Half a Century', | |
51 => 'Tweak of the Thumb', | |
52 => 'Danny La Rue', | |
53 => 'Stuck in the Tree', | |
54 => 'Clean the Floor', | |
55 => 'Snakes Alive', | |
56 => 'Was she worth it', | |
57 => 'Heinz Varieties', | |
58 => 'Make the, Wait', | |
59 => 'Brighton Line', | |
60 => 'Five Dozen', | |
61 => 'Bakers Bun', | |
62 => 'Turn on the Screw', | |
63 => 'Tickle Me', | |
64 => 'Red Raw', | |
65 => 'Old Age Pension', | |
66 => 'Clickety Click', | |
67 => 'Made in Heaven', | |
68 => 'Saving Grace', | |
69 => 'Either Way Up', | |
70 => 'Three score & Ten', | |
71 => 'Bang on the Drum', | |
72 => 'Six Dozen', | |
73 => 'Queen B', | |
74 => 'Candy Store', | |
75 => 'Strive & Strive', | |
76 => 'Trombones', | |
77 => 'Sunset Strip', | |
78 => 'Heavens Gate', | |
79 => 'One More Time', | |
80 => 'Eight & Blank', | |
81 => 'Stop & Run', | |
82 => 'Straight On Through', | |
83 => 'Time for Tea', | |
84 => 'Seven Dozen', | |
85 => 'Staying Alive', | |
86 => 'Between the Sticks', | |
87 => 'Torquay in Devon', | |
88 => 'Two Fat Ladies', | |
89 => 'Nearly There', | |
90 => 'Top of the Shop' | |
} | |
intros = [ | |
"Thanks for turning up everyone, let's get started!" | |
] | |
chitchat = [ | |
"Isn't it a lovely day? Lets get going!", | |
"Shall I tell a joke? Ok, never mind, on with the game!", | |
"Here we go!", | |
"Next number!", | |
"Are we ready?!" | |
] | |
endings = [ | |
"That's a wrap folks! Thanks for coming everybody!" | |
] | |
potential_numbers = (1..90).to_a | |
def speak(text, pause = 1) | |
`say "#{text}!"` | |
sleep(pause) | |
end | |
#BEGIN | |
speak(intros.sample, 2) | |
while potential_numbers.size > 0 do | |
number = potential_numbers.sample | |
potential_numbers.delete number | |
speak(chitchat.sample) if rand(5) == 1 | |
if mappings.has_key? number | |
speak("#{mappings[number]}", 1.0/3) | |
speak("#{number}", 4) | |
else | |
speak(number, 4) | |
end | |
end | |
speak(endings.sample) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment