0.8.0 • Published 9 years ago

powerball v0.8.0

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

powerball

My attempt at predicting Powerball numbers with nodejs

npm version

See it in action here

command-line

I included the command powerball, if you install with npm install -g powerball that will predict/check numbers.

Usage: powerball [options] [numbers]

Options:
  -h, --help       Show help
  --count, -c      Count of number sets to return.              [default: 10]
  --powerplay, -p  For checking: did you enable powerplay?      [boolean]
  --time, -t       What time should the rules be pulled from?   [default: now]

Examples:
  powerball -c 5               Get 5 numbersto play
  powerball 01 18 41 43 46 22  See if your numbers got pulled in last draw

Objects

Statistical : object

Kind: global namespace

-

Statistical.μ(freq) ⇒ Number

Calculate arithmetic mean of ball-count

Kind: static method of Statistical
Returns: Number - Arithmatic Mean of weights

ParamTypeDescription
freqObjectA single ball-frequency array from frequencies

Example (Get Arithmetic Mean of Red Balls)
var f = powerball.frequencies(winners) console.log(powerball.μ(f.red)) Example (Get Arithmetic Mean of White Balls)
console.log(powerball.mean(f.white))

-

Statistical.gmean(freq) ⇒ Number

Calculate geometric mean of ball-count

Kind: static method of Statistical
Returns: Number - Geometric Mean of weights

ParamTypeDescription
freqObjectA single ball-frequency array from frequencies

Example (Get Geometric Mean of Red Balls)
var f = powerball.frequencies(winners) console.log(powerball.gmean(f.red)) Example (Get Geometric Mean of White Balls)
console.log(powerball.gmean(f.white))

-

Statistical.median(freq) ⇒ Number

Calculate median of ball-count

Kind: static method of Statistical
Returns: Number - Median of weights

ParamTypeDescription
freqObjectA single ball-frequency array from frequencies

Example (Get Median of Red Balls)
var f = powerball.frequencies(winners) console.log(powerball.median(f.red)) Example (Get Median of White Balls)
console.log(powerball.median(f.white))

-

Statistical.range(freq) ⇒ Array

Calculate range of ball-count

Kind: static method of Statistical
Returns: Array - High/low range of numbers for weights.

ParamTypeDescription
freqObjectA single ball-frequency array from frequencies

Example (Get Range of Red Balls)
var f = powerball.frequencies(winners) console.log(powerball.range(f.red)) Example (Get Range of White Balls)
console.log(powerball.range(f.white))

-

Statistical.σ(freq) ⇒ Number

Calculate standard deviation of ball-count

Kind: static method of Statistical
Returns: Number - Standard Deviation of weights

ParamTypeDescription
freqObjectA single ball-frequency array from frequencies

Example (Get Standard Deviation of Red Balls)
var f = powerball.frequencies(winners) console.log(powerball.stddev(f.red)) Example (Get Standard Deviation of White Balls)
console.log(powerball.σ(f.white))

-

Powerball : object

Kind: global namespace

-

Powerball.balls(date) ⇒ Array

Get ball-maxes for a given date

Kind: static method of Powerball
Returns: Array - white, red ball-max

ParamTypeDefaultDescription
dateDatenowDate to check

Example (Current Ball Maxes)
// returns 69, 26 powerball.balls() Example (Old Ball Maxes)
// returns 59, 39 powerball.balls(new Date('1/8/2009'))

-

Powerball.numbers() ⇒ Promise

Get past winning numbers

Kind: static method of Powerball
Returns: Promise - Resolves to array of winner objects
Example (Get Current Numbers)
powerball.numbers().then(winners => { console.log(winners) })

-

Powerball.frequencies(winners) ⇒ Object

Calculate frequencies of white & red balls

Kind: static method of Powerball
Returns: Object - keyed with number, value is frequency

ParamTypeDescription
winnersArrayThe winning numbers from numbers

Example (Get Frequency Counts)
console.log(powerball.frequencies(winners))

-

Powerball.predict(white, red, time) ⇒ Array

Predict winning numbers

Kind: static method of Powerball
Returns: Array - The numbers you should play

ParamTypeDefaultDescription
whiteObjectWhite ball-frequency array from frequencies
redObjectRed ball-frequency array from frequencies
timeDatenowDifferent dates have differnt ball-sets

Example (Get Prediction)
var f = powerball.frequencies(winners) console.log(powerball.predict(f.white, f.red)) Example (Predict For an Old Date)
console.log(powerball.predict(f.white, f.red, new Date('1/1/98')))

-

Powerball.payout(pick, winner, powerplay) ⇒ Boolean | Number

Check if your numbers won (only current rules) http://www.powerball.com/powerball/pb_prizes.asp

Kind: static method of Powerball
Returns: Boolean | Number - true for jackpot, if Number: amount you won

ParamTypeDescription
pickArrayYour number picks (6-length array)
winnerObjectA single draw from number()
powerplayBooleanDid you mark power-play on your ticket?

Example (Check If You Won)
powerball.numbers().then(winners => { console.log(powerbal.payout(5, 6, 10, 36, 43, 11, winners.pop(), true)) })

-

0.8.0

9 years ago

0.5.0

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.10

10 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.1

10 years ago