simple underscore.js projects, walk through, & tutorial


Lottery DataBase Analysis - 11 (on screen JSON output)



   


This is the old lotteryData object (included to troubleshoot the new percentData object array, next:

1 Nada Yet



var percentData = {};
percentData = _.chain(lotteryData)
    .map(function(a){
        a.pAvailable = a.numAvailable / a.numWinners;
        a.pAvailable = Math.floor(a.pAvailable * 10000) / 100;
        return _.pick(a, 'prizeThis', 'pAvailable');
    })
    .value();

percentData =
2 Nada Yet



var percentTicketsAvailableAve = (numTickets - numTicketsBoughtAverage) / numTickets;
    percentTicketsAvailableAve = Math.floor(percentTicketsAvailableAve * 10000) / 100;

3 Nada Yet



var percentTicketsAvailableMin = (numTickets - numTicketsBoughtMax) / numTickets;
    percentTicketsAvailableMin = Math.floor(percentTicketsAvailableMin * 10000) / 100;
4 Nada Yet



var percentTicketsAvailableMax = (numTickets - numTicketsBoughtMin) / numTickets;
    percentTicketsAvailableMax = Math.floor(percentTicketsAvailableMax * 10000) / 100;

5 Nada Yet

6 Nada Yet





Permanent Display Stat area (summary of all meaningful stats, to date for this project):

var derivedLotteryStats = {
nada yet
nada yet
nada yet
nada yet
nada yet
nada yet

nada yet
nada yet

nada yet
nada yet
nada yet
nada yet

nada yet
nada yet
nada yet
};



_.moreUnderscoreProjects

© Copyright 2013 Brett Paufler


Please Note: I am an idiot.  No seriously.  The odds of my gambling odds calculations being correct are likely on par with my odds of ever winning.  You have been warned.