Skip to content

Commit 9b491a0

Browse files
authored
Merge pull request #9 from tphummel/bp4qbp-codex/add-support-for-additional-table-rules
Add customizable table rules
2 parents 1eb4361 + ce8600c commit 9b491a0

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@ const rules = {
7979
}
8080
```
8181

82+
For example, to make boxcars (12) a come out win instead of a loss:
83+
84+
```js
85+
const rules = {
86+
comeOutLoss: [2, 3],
87+
comeOutWin: [7, 11, 12]
88+
}
89+
```
90+
8291
## what? why?
8392

8493
I like to play craps sometimes. I have a handful of strategies I like to play. It is time consuming to play in an app. I'd like to play 5, 50, 500 hands very fast using various strategies. Which strategies are best is well understood, the variability comes in with how aggressive your strategies are and the level of risk you assume at any given moment. And of course the dice outcomes and their deviation from long term probabilities and how they interact with the strategies you employ is the fun part. This simulator lets me scratch my craps itch very quickly.

index.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ tap.test('comeout with custom rules', (t) => {
211211

212212
const result = lib.shoot(handState, [6, 6], rules)
213213
t.equal(result.result, 'comeout win')
214+
t.notOk(result.point)
215+
t.equal(result.die1, 6)
216+
t.equal(result.die2, 6)
217+
t.equal(result.diceSum, 12)
214218
t.equal(result.isComeOut, true)
215219

216220
t.end()

0 commit comments

Comments
 (0)