https://github.com/testica/bean-machine
Bean Machine simulator in python
https://github.com/testica/bean-machine
bean-machine probabilistic python
Last synced: about 1 year ago
JSON representation
Bean Machine simulator in python
- Host: GitHub
- URL: https://github.com/testica/bean-machine
- Owner: testica
- Created: 2015-11-15T02:58:36.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-19T20:21:44.000Z (over 10 years ago)
- Last Synced: 2025-02-15T05:16:52.800Z (over 1 year ago)
- Topics: bean-machine, probabilistic, python
- Language: Python
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bean Machine Simulator
Simulation of Bean Machine built in pyhton.
## Requisites
* Python v 2.7.x
## Usage
* You have to specify number of levels with flag `-l` (required)
* You have to specify number of balls with flag `-b` (required)
* If you want get the result in percentage, use flag `-p` (optional).
## Example
20 levels and 500 balls are thrown
`python bean_machine.py -l 20 -b 500`
output: `[0, 0, 0, 1, 1, 11, 9, 44, 46, 82, 79, 90, 56, 52, 21, 4, 4, 0, 0, 0, 0]`
(output may be different)
-------------------------------------------------------
10 levels and 800 balls are thrown
`python bean_machine.py -l 10 -b 800 -p`
output: `['0.25%', '0.88%', '3.62%', '10.13%', '20.13%', '24.88%', '22.25%', '14.12%', '2.63%', '1.0%', '0.13%']`
(output may be different)