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


In reply to Bull$#!^ Bingo (was :By far, the coolest use for perl) by shirkdog_perl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.