Using a nice shuffler from the Perl Cookbook, and information from a very funny email, I created this CGI script to generate a Bullshit Bingo Card. The game works as such, every player has a card when attending a meeting. When bullshit is said, you score it on your card. When someone aquires 5 in a row, they stand up and yell BULLSHIT. The html print statements are sloppy, however, I whipped this up in 5 mins, and was on webserver serving out cards in 2.
#!/usr/bin/perl -wT
#
# BullShit Bingo Script Version 1.1 Last Modified 6/17/02 11:20
# --Michael Shirk
# Generates a random Bullshit bingo card when called from the
# webserver, and prints it in HTML.
#
#################################################################
use strict;
use CGI;
my $q = new CGI;
my @array = ("Synergy", "Strategic fit", "Core competencies", "Out of
+the box",
"Bottom line", "Revisit", "Take that off line", "24/7", "O
+ut of the loop",
"Benchmark", "Value-added", "Proactive", "Win-win", "Think out
+ side the box",
"Fast track", "Result driven", "Empower (ment)", "Knowledge ba
+se", "At the end of the day",
"Touch base", "Mindset", "Client focus (ed)", "Ballpark", "Gam
+e plan",
"Leverage", "Top down", "User friendly", "On time", "Within bu
+dget", "Forecast",
"Optimistic");
sub shuffle {
my $array = shift;
my $i;
for ($i = @$array; --$i; ) {
my $j = int rand ($i+1);
next if $i == $j;
@$array[$i,$j] = @$array[$j,$i];
}
for (my $k = 0; $k < $#array; $k++) {
print $array[$k];
}
}
shuffle( \@array );
print "Content-type: text/html";
print "\n";
print "\n";
print "<html>";
print "<body>";
print "<h1 align=\"center\">Bullshit Bingo</h1>";
print "<table width=\"100%\" height=\"400\" border=\"3\" align=\"cente
+r\">";
print "<tr>";
print "<td><br><br><br><p align=\"center\">$array[0]<br><br><br></td>"
+;
print "<td><br><br><br><p align=\"center\">$array[1]<br><br><br></td>"
+;
print "<td><br><br><br><p align=\"center\">$array[2]<br><br><br></td>"
+;
print "<td><br><br><br><p align=\"center\">$array[3]<br><br><br></td>"
+;
print "<td><br><br><br><p align=\"center\">$array[4]<br><br><br></td>"
+;
print "</tr>";
print "<tr>";
print "<td><br><br><br><p align=\"center\">$array[5]<br><br><br></td>"
+;
print "<td><br><br><br><p align=\"center\">$array[6]<br><br><br></td>"
+;
print "<td><br><br><br><p align=\"center\">$array[7]<br><br><br></td>"
+;
print "<td><br><br><br><p align=\"center\">$array[8]<br><br><br></td>"
+;
print "<td><br><br><br><p align=\"center\">$array[9]<br><br><br></td>"
+;
print "</tr>";
print "<tr>";
print "<td><br><br><br><p align=\"center\">$array[10]<br><br><br></td>
+";
print "<td><br><br><br><p align=\"center\">$array[11]<br><br><br></td>
+";
print "<td><br><br><br><p align=\"center\">$array[12]<br><br><br></td>
+";
print "<td><br><br><br><p align=\"center\">$array[13]<br><br><br></td>
+";
print "<td><br><br><br><p align=\"center\">$array[14]<br><br><br></td>
+";
print "</tr>";
print "<tr>";
print "<td><br><br><br><p align=\"center\">$array[15]<br><br><br></td>
+";
print "<td><br><br><br><p align=\"center\">$array[16]<br><br><br></td>
+";
print "<td><br><br><br><p align=\"center\">$array[17]<br><br><br></td>
+";
print "<td><br><br><br><p align=\"center\">$array[18]<br><br><br></td>
+";
print "<td><br><br><br><p align=\"center\">$array[19]<br><br><br></td>
+";
print "</tr>";
print "<tr>";
print "<td><br><br><br><p align=\"center\">$array[20]<br><br><br></td>
+";
print "<td><br><br><br><p align=\"center\">$array[21]<br><br><br></td>
+";
print "<td><br><br><br><p align=\"center\">$array[22]<br><br><br></td>
+";
print "<td><br><br><br><p align=\"center\">$array[23]<br><br><br></td>
+";
print "<td><br><br><br><p align=\"center\">$array[24]<br><br><br></td>
+";
print "</tr>";
print "</table>";
print $q->end_html;
edited: Thu Dec 5 19:02:13 2002
by jeffa - title change
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.