Skip to content

Instantly share code, notes, and snippets.

@druu
Created May 17, 2014 03:58
Show Gist options
  • Save druu/eccf3e2b161f93069352 to your computer and use it in GitHub Desktop.
Save druu/eccf3e2b161f93069352 to your computer and use it in GitHub Desktop.
body {
font-family: sans-serif;
}
table {
border-top: 1px solid #ccc;
border-left: 1px solid #ccc;
}
td {
border-bottom: 1px solid #ccc;
border-right: 1px solid #ccc;
width: 100px;
height: 100px;
text-align: center;
font-size: 12px;
}
<!DOCTYPE html>
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
<meta charset="utf-8">
<title>BBB - (In)Official™ Cursing Bingo</title>
</head>
<body>
<p>
Click cell to check. <button id="resetGame">Reset Game</button><br>
<table cellspacing="0" cellpadding="0">
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
<p>
<input type="checkbox" id="mergeLists"> Merge Base List with Custom List<br><br>
Custom Wordlist (one item per line):<br>
<textarea rows="20" cols="40" id="customWordList"></textarea><br>
</p>
</body>
</html>
/**
* BBB - (In)Official™ Cursing Bingo
* © 2014 - david.wosnitza (druu)
* License: http://www.wtfpl.net/txt/copying/
**/
;(function init(win, doc, undefined){
var wordList = (function(){
var base = ["Cunt", "Stupid Cunt", "Stupid Fucking Cunt", "Total Fucking Cunt", "Stupid Old Cunt", "You Stupid Fucking Cunt", "You Stupif Fucking Arseholing Cunt", "Fuck", "Fucking Cunt", "Fuck You", "Fuck Off", "Fucking Arseholes", "Christ On A Fucking Bike", "Mother Fucker", "Mother Fucking Arsehole", "Outta the Mother Fucking Way", "Mother Fucking Mother Fucker", "Shit", "Shit It", "Shit For Fucking Brains", "Shitting Fucking Tit", "Bollock", "Bollocks", "Load Of Bollocks", "Bollocks To That", "Arsehole", "Big Arsehole", "Looking Like A Right Arsehole", "Arseholes For Goalposts", "Bastard", "Fucking Old Bastard", "Silly Bastard", "Bastard Fucking Tit", "Cock", "Cocking Shitter", "Useless Fucking Cock", "Cock Garage", "Wank", "Bullshitting Wanker", "Stupid Old Wanker", "Face Like A Wanker", "Whore", "Fucking Old Whore", "Local Whore", "Whoring It About", "Arse", "Arse It", "You Big Fucking Arse", "Fuck Right Off Out Of It You Arse", "Twat", "Twat Him One", "Buggering Old Twat", "Twat Pack", "Piss", "Stinks Like Piss", "Pissed As A Cunt", "Pissing Into The Wind", "Prat", "You Prat", "Easy Going Prat", "Prat In A Hat", "Shitting Prat", "Who's The Prat In The Corner?", "Balls", "Fucking Balls To It", "Fucking Ballache", "Shitting Ballbreaker", "Grow Some Fucking Balls", "Only Got One Ball", "Bloody", "Bloody Hell", "Bloody Fucking Shit", "Bloody Fucking Hell", "Shit Your Bloody Nose", "What The Bloody Hell's Going On here?", "Sod", "Sod This", "Bugger Off You Sod", "You Stupid Fucking Sod", "Sod The Lot Of You", "Sod The Fuck Off", "Tit", "You Look Like A Tit", "Titting About", "Useless Pair Of Tits", "Getting On Me Tits", "Blue Tit", "One Tit Bigger Than The Other", "Stink Like A Piss Ceefax", "Plant's Arsehole", "Council Tit Gristler", "Your Kunting Me Fucking Head Out Cunt", "Piss In A Git Cup", "Acting Like A Cock Snake On Plant Food", "Face Like A Shitflap", "Two Cunts In A Piss Factory", "International Cunt Circus", "Shit Me Own Piss", "Pringle Wearing Cunt", "Hammer The Bollock Out Of It", "Arsehole For A Brain", "Shitting A Fucking Breeze Block"];
var util = {
shuffle: function shuffle(a){ //v1.1
var o = a.slice();
for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
return o;
},
getBase: function getBase(){ return base.slice(); },
getCustomBase: function getCustomBase(merged){
return doc.getElementById('customWordList').value.split("\n").concat(merged ? base : []);
}
};
return {
getBase: util.getBase,
getRandomSubset: function(wordCount, customWordList){
var wordBase = customWordList ? util.getCustomBase(doc.getElementById('mergeLists').checked) : util.getBase();
return util.shuffle(wordBase).splice(Math.floor(Math.random * (base.length - (wordCount +1))), wordCount);
}
};
})();
var cells = doc.getElementsByTagName('td'),
resetButton = doc.getElementById('resetGame'),
bbBingo = {
checkCell: function checkCell() {
this.style.background = '#A6D785';
},
init: function init(e) {
var cellCount = cells.length,
words = wordList.getRandomSubset(cellCount, doc.getElementById('customWordList').value),
centerCellIndex = Math.floor(cellCount / 2),
color = ['#fafafa','#ffffff'],
cell;
while(cellCount--){
cell = cells[cellCount];
cell.innerText = (cellCount !== centerCellIndex) ? words[cellCount] : '***JOKER***';
cell.style.background = color[cellCount % 2];
cell.onclick = bbBingo.checkCell;
}
return false;
}
};
resetButton.onclick = bbBingo.init;
bbBingo.init();
})(window, document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment