Some suggested basic 'rules': (1) Must work with use strict and use warnings (2) The code itself must 'act out' the song title (3) The OUTPUT of the script must also serve as a clue to the song title.
And three examples from the very excellent Smiths to start the ball rolling. First up, 'There is a light that never goes out':
#/usr/bin/perl use strict; use warnings; print "Guess the song title:\n"; # 'There is a light that never goes out' (The Smiths) my $light = 1; while (1) { $light = 0 if 1 < 0; print "Light is ", $light ? "on" : "off", "\n"; sleep 1; }
Second example, 'Some girls are bigger than others':
#/usr/bin/perl use strict; use warnings; print "Guess the song title:\n"; # 'Some girls are bigger than others' (The Smiths) for my $girl (1..5) { print "Girl number $girl is size ", int( rand 20 ), "\n"; sleep 1; }
And finally for now, 'Stop me if you think you've heard this one before':
#/usr/bin/perl use strict; use warnings; print "Guess the song title:\n"; # 'Stop me if you think you've heard this one before' (The Smiths) my %heard_before; my @joke_topics = ('penguin', 'chicken', 'elephant', 'badger', 'ape'); JOKE: while (1) { my $topic = $joke_topics[ int( rand 5 ) ]; print "Did you hear the one about the $topic...?\n"; if ($heard_before{ $topic }++) { print "...OK you better stop me, I'm repeating myself now.\n"; last JOKE; } sleep 1; }
Any other ideas?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Song titles challenge
by dewey (Pilgrim) on Jul 26, 2007 at 19:17 UTC | |
|
Re: Song titles challenge
by mr_mischief (Monsignor) on Jul 26, 2007 at 22:23 UTC | |
|
Re: Song titles challenge
by Anonymous Monk on Jul 27, 2007 at 00:07 UTC | |
|
Re: Song titles challenge
by thezip (Vicar) on Jul 27, 2007 at 00:42 UTC | |
|
Re: Song titles challenge
by pemungkah (Priest) on Jul 27, 2007 at 22:49 UTC | |
|
Re: Song titles challenge
by oxone (Friar) on Jul 28, 2007 at 09:21 UTC |