Judge Wapner
by Eric Miller
CSS
body {
font-family:Arial, Verdana, Sans-Serif;
font-size:13px;
}
table {
width:90%;
border:1px solid #333;
margin:10px auto;
}
thead th {
text-align:center;
}
tbody tr:nth-child(odd) {
background-color:rgba(200,200,200,.9);
}
.lotto-title {
text-align:center;
font-weight:bold;
}
JavaScript
/**
* @author millere
* @TODO: probability matrix
*/
/* globals */
function isset(variable) {
return typeof(variable) != "undefined" && variable !== null;
}
function isArray(obj) {
var is = false;
if(typeof(obj) === 'object' && obj !== null) { // Array
is = true;
}
return is;
}
String.prototype.toCamel = function(){
return this.replace(/(\-[a-z])/g, function($1){
return $1.toUpperCase().replace('-','');
});
};
/**
* PB Javascript
* probability: number of times combination drawn / total number of drawings
*/
var com = com || {};
com.pseudoninja.lottery = {
constants:{ //[CONSTANTS]
powerball:{
name: 'Powerball',
src: 'http://www.powerball.com/powerball/winnums-text.txt',
data: [['1/4/2012', '50', '35', '21', '47', '46', '2', '4'],
['12/31/2011', '5', '25', '40', '23', '28', '34', '4'],
['12/28/2011', '16', '27', '45', '41', '21', '14', '2'],
['12/24/2011', '52', '51', '16', '14', '30', '19', '2'],
['12/21/2011', '31', '15', '13', '54', '10', '18', '5'],
['12/17/2011', '59', '28', '51', '13', '49', '33', '4'],
['12/14/2011', '46', '52', '24', '56', '2', '19', '5'],
['12/10/2011', '33', '41', '4', '19', '59', '9', '5'],
['12/7/2011', '39', '20', '14', '40', '3', '37', '2'],
['12/3/2011', '18', '5', '33', '43', '45', '8', '3'],
['11/30/2011', '47', '6', '2', '34', '35', '22', '2'],
['11/26/2011', '55', '20', '37', '45', '39', '28', '2'],
['11/23/2011', '30', '35', '57', '4', '59', '25', '2'],
['11/19/2011', '16', '9', '17', '28', '30', '11', '3'],
['11/16/2011', '22', '25', '39', '13', '51', '28', '2'],
['11/12/2011', '56', '4', '35', '51', '36', '8', '5'],
['11/9/2011', '58', '59', '35', '5', '57', '12', '3'],
['11/5/2011', '43', '39', '2', '33', '40', '26',...