Skip to content

SlexAxton/gaga.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

A Helper library for creating card and hand objects and evaluating their worth.

Still very early development.

Requires: Underscore.js

More to come with:

  • Direct Hand Comparison
  • Hold em' mode (shared 5, plus 2 private)
  • hand/card validation

Right now it's pretty simple.

Create a card:

var aceOfClubs = gaga.createCard('A', 'C');

Create a hand:

var royal_flush = gaga.createHand([
    ['T', 'clubs'],
    ['J', 'clubs'],
    ['Q', 'clubs'],
    ['K', 'clubs'],
    ['A', 'clubs']
]);

Then run the identify function on a hand, and get it's value:

var result = royal_flush.identify();

// this makes: 
{
  cards: Array[5], // An array of the cards that caused the hand
  name: "Straight Flush", // Pretty name
  rank: 8, // The higher, the better
  type: "straight_flush" // key name
}

About

A Poker Utility Library for JavaScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published