Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>OK, I'll have another go. This will be written in a sort of php/psuedocode thing.</p> <pre><code>while($line = get the next line) { if($line contains 'seat') { $player = get player from $line $pool = get player pool from $line $bettingMatrix[$player]['pool'] = $pool; } else if($line contains 'blind') { $player = get player from $line $betValue = get blind value from $line $bettingMatrix[$player]['betTotal'] = $betValue $bettingMatrix['pot'] += $betValue //keep a sum of the pot } else if($line contains 'raises') { $player = get player from $line $betValue = get value from $line $betMade = $betValue - $bettingMatrix[$player]['betTotal']; //actual amount raised by $bettingMatrix[$player]['betTotal'] = $betValue //$line contains total bet this hand (shortcut) $bettingMatrix['raiseValue'] = $betMade $bettingMatrix['pot'] += $betMade //keep a sum of the pot } else if($line contains 'calls') { $player = get player from $line //if player has called, can work out bet from raiseValue $betMade = $bettingMatrix['raiseValue'] $bettingMatrix[$player]['betTotal'] += $betMade $bettingMatrix['pot'] += $betMade //keep a sum of the pot } else if(substr($line, 0, 3) == ' Wins ') //probably do something about players named Wins :) { //assume all bets resolved foreach($bettingMatrix[$player]) { update pool. zero betTotal } zero pot, zero raiseValue } } </code></pre> <p>erm, it's pretty rough and ready, and I probably wouldn't class it as a Parser as such, but it does just about work out all the values you need, I think anyway. The 2 $betMade variables should end up with the values you want.</p> <p>Edit: I've just noticed that it doesn't quite work if no-one raises and everyone just calls or folds (and probably dies horribly if everyone just folds or whatever). It does need a little bit more work, but it is the general gist - call it a half-answer. Sorry.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload