Skip to content

Instantly share code, notes, and snippets.

@guyht
Created April 30, 2014 23:00
Show Gist options
  • Save guyht/c09c6fd66309e365154f to your computer and use it in GitHub Desktop.
Save guyht/c09c6fd66309e365154f to your computer and use it in GitHub Desktop.
Jade template for pkrsess
case hand.gametype.limit
when 'nl'
- var lim = 'No Limit'
case hand.gametype.flavour
when 'holdem'
- var flav = 'Holdem'
case hand.session.buyincurrency
when 'USD'
- var curr = '$'
- var c = {c: 'club', d: 'diamond', h: 'heart', s: 'spade'}
- var hand_desc = hand.sitename + ' ' + curr + (hand.session.buyin/100) + '+' + curr + (hand.session.fee/100) + ' ' + lim + ' ' + flav + ' ' + hand.gametype.sb + '/' + hand.gametype.bb + ' - ' + hand.gametype.maxseats + ' players'
.pokercloud
.hand-desc= hand_desc
// Stacks
.stacks
each pl, stack in hand.hand.stacks
.stack= stack + ' ' + pl
- actions = ['BLINDSANTES', 'PREFLOP', 'FLOP', 'TURN', 'RIVER']
- actions_nice = ['Blinds & Antes', 'Pre Flop', 'Flop', 'Turn', 'River']
.streets
- each action in actions
if(hand.hand.actions[action])
- act = hand.hand.actions[action]
// Street info
br
.street
.str-name.fl= actions_nice[actions.indexOf(action)]
if(hand.hand.streettotals[action])
.str-pot.fl= hand.hand.streettotals[action]
if(hand.hand.board[action] && hand.hand.board[action].length)
.str-board.fl
each card in hand.hand.board[action]
.fl= card[0]
.card.fl(class=c[card[1]])
// Action info
.actions
each ac in act
- player = ac[0]
case ac[1]
when 'small blind'
.action.fl.mr.small_blind= player + ' posts small blind ' + ac[2] + ','
when 'big blind'
.action.fl.mr.big_blind= player + ' posts big blind ' + ac[2] + ','
when 'checks'
.action.fl.mr.checks= player + ' checks' + ','
when 'bets'
.action.fl.mr.bets= player + ' bets ' + ac[2] + (ac[3]? ' and is all in' : '') + ','
when 'folds'
.action.fl.mr.folds= player + ' folds' + ','
when 'calls'
.action.fl.mr.calls= player + ' calls ' + ac[2] + (ac[3]? ' and is all in' : '') + ','
when 'raises'
.action.fl.mr.raises= player + ' raises to ' + ac[3] + (ac[5] ? ' and is all in': '') + ','
br
.summary
.final-pot= 'Final pot: ' + (hand.hand.totalcollected + hand.hand.rake)
- each showdown, pl in hand.hand.showdownstrings
card1 = hand.hand.holecardssummary[pl][0]
card2 = hand.hand.holecardssummary[pl][1]
.showdown
.fl= pl + ' shows '
.fl= card1[0]
.card.fl(class=c[card1[1]])
.fl= card2[0]
.card.fl(class=c[card2[1]])
.showndown.fl= ' ' + showdown
.winnings
-each amount, winner in hand.hand.collectees
.win= winner + ' collects ' + amount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment