poker
Version:
Texas Hold'em Poker model
28 lines (25 loc) • 733 B
JavaScript
// const poker = require('bindings')('addon');
const poker = require('./poker')
const t = new poker.Table({ ante: 0, smallBlind: 10, bigBlind: 20 })
t.sitDown(0, 1000)
t.sitDown(3, 1000)
t.sitDown(5, 1000)
t.sitDown(8, 1000)
t.startHand(8)
console.log(t.isHandInProgress())
console.log(t.holeCards())
t.actionTaken('fold')
t.actionTaken('fold')
t.actionTaken('fold')
t.endBettingRound()
t.showdown()
console.log('before hand start')
t.startHand()
console.log('after hand start')
// Caused a crash before
const table = new poker.Table({ ante: 0, smallBlind: 10, bigBlind: 20 })
table.sitDown(1, 1000)
table.sitDown(8, 1000)
table.startHand()
table.standUp(1)
console.log(table.isBettingRoundInProgress())