\
"; // // Some canned display HTML here to keep the page generating code readable. // var reload_info = " \ \\ This page dynamically draws a new Bingo! card when loaded. \ Enable your browser's JavaScript feature to see the card. This \ page may not work with Microsoft Internet Explorer 3.xx. \
"; // // Returns TRUE if the user selected to have the BINGO free // square in the middle of the bingo card. // function centerBingoSquare() { return 0 <= location.search.indexOf('center=yes'); } // // Insert the user's data into the input form. Use this // function to repopulate the input form to save the user // typing if s/he has made a mistake. // function giveUserFeedback() { document.bingo_word_input.title.value = getPageTitle(); document.bingo_word_input.buzzwords.value = getBuzzwordList().join(", "); alert("You must enter at least 25 words.\nYou currently have " + getBuzzwordList().length + " buzzwords."); } // // Extract the user's custom page title from the URL. // function getPageTitle() { var result = location.search.match(/title=([^&]+)/i); return (result == null || result[1] == null) ? 'Custom Buzzword Bingo!' : unescape(result[1]).replace(/\+/g, " "); } // // Extract the user's buzzwords from the URL. // function getBuzzwordList() { var result = location.search.match(/buzzwords=([^&]+)/i); if (result == null || result[1] == null) return; return unescape(result[1]).replace(/\++/g, " ").replace(/\s*,\s*/g, ",").split(","); } // // Generate the bingo card. // function makeBingoCard() { // 1. Randomize the list of words. for (var i = 0; i < bingowords.length; i++) { temp = bingowords[i]; j = Math.floor(Math.random() * bingowords.length); bingowords[i] = bingowords[j]; bingowords[j] = temp; } // 2. Place the free (BINGO!) square on the card. bingowords[centerBingoSquare() ? 12 : Math.floor(Math.random() * 25)] = 'BINGO'; // 3. Convert the list to HTML. var bingocard = 'B | I | N | G | O | ';
for (var i = 0; i < 5; i++) {
bingocard += '
|---|---|---|---|---|
' + bingowords[i*5 + j] + ' | ';
}
bingocard += '
Back to Buzzword Bingo page
More about Business Buzzword Bingo