Giter Club home page Giter Club logo

node-craps's Introduction

node-craps

Github Workflow Status

๐ŸŽฒ๐ŸŽฒ craps simulator ๐Ÿ’ต

simulate a hand

โžœ  node hands.js 1

Simulating 1 Craps Hand(s)

Dice Roll Distribution
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ (index) โ”‚ Values โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚    2    โ”‚   0    โ”‚
โ”‚    3    โ”‚   0    โ”‚
โ”‚    4    โ”‚   0    โ”‚
โ”‚    5    โ”‚   2    โ”‚
โ”‚    6    โ”‚   2    โ”‚
โ”‚    7    โ”‚   1    โ”‚
โ”‚    8    โ”‚   3    โ”‚
โ”‚    9    โ”‚   3    โ”‚
โ”‚   10    โ”‚   1    โ”‚
โ”‚   11    โ”‚   2    โ”‚
โ”‚   12    โ”‚   0    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Session Summary
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚    (index)     โ”‚ Values โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚   handCount    โ”‚   1    โ”‚
โ”‚   rollCount    โ”‚   14   โ”‚
โ”‚   pointsSet    โ”‚   3    โ”‚
โ”‚   pointsWon    โ”‚   2    โ”‚
โ”‚  comeOutWins   โ”‚   0    โ”‚
โ”‚ comeOutLosses  โ”‚   0    โ”‚
โ”‚ netComeOutWins โ”‚   0    โ”‚
โ”‚    neutrals    โ”‚   8    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Hands

Hand: 1
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ (index) โ”‚ die1 โ”‚ die2 โ”‚ diceSum โ”‚   result    โ”‚ isComeOut โ”‚ point โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚    0    โ”‚  3   โ”‚  6   โ”‚    9    โ”‚ 'point set' โ”‚   false   โ”‚   9   โ”‚
โ”‚    1    โ”‚  4   โ”‚  5   โ”‚    9    โ”‚ 'point win' โ”‚   true    โ”‚       โ”‚
โ”‚    2    โ”‚  3   โ”‚  5   โ”‚    8    โ”‚ 'point set' โ”‚   false   โ”‚   8   โ”‚
โ”‚    3    โ”‚  3   โ”‚  6   โ”‚    9    โ”‚  'neutral'  โ”‚   false   โ”‚   8   โ”‚
โ”‚    4    โ”‚  5   โ”‚  5   โ”‚   10    โ”‚  'neutral'  โ”‚   false   โ”‚   8   โ”‚
โ”‚    5    โ”‚  3   โ”‚  5   โ”‚    8    โ”‚ 'point win' โ”‚   true    โ”‚       โ”‚
โ”‚    6    โ”‚  2   โ”‚  6   โ”‚    8    โ”‚ 'point set' โ”‚   false   โ”‚   8   โ”‚
โ”‚    7    โ”‚  2   โ”‚  3   โ”‚    5    โ”‚  'neutral'  โ”‚   false   โ”‚   8   โ”‚
โ”‚    8    โ”‚  1   โ”‚  4   โ”‚    5    โ”‚  'neutral'  โ”‚   false   โ”‚   8   โ”‚
โ”‚    9    โ”‚  5   โ”‚  6   โ”‚   11    โ”‚  'neutral'  โ”‚   false   โ”‚   8   โ”‚
โ”‚   10    โ”‚  2   โ”‚  4   โ”‚    6    โ”‚  'neutral'  โ”‚   false   โ”‚   8   โ”‚
โ”‚   11    โ”‚  1   โ”‚  5   โ”‚    6    โ”‚  'neutral'  โ”‚   false   โ”‚   8   โ”‚
โ”‚   12    โ”‚  5   โ”‚  6   โ”‚   11    โ”‚  'neutral'  โ”‚   false   โ”‚   8   โ”‚
โ”‚   13    โ”‚  3   โ”‚  4   โ”‚    7    โ”‚ 'seven out' โ”‚   true    โ”‚       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

what? why?

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.

dev

git clone [email protected]:tphummel/node-craps.git
cd node-craps
npm i
npm t

node-craps's People

Contributors

tphummel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.