Code Monkey home page Code Monkey logo

galton-board-py-v2's Introduction

Galton Board in Python

A simple Galton board simulation in pure Python. Michael from Vsauce has an amazing video explaining the concept : https://www.youtube.com/watch?v=UCmPmkHqHXk

Requirement

Tested on Python3.6. Doesn't require any additional libraries.

How to use (non programmers)

Windows

  1. Download and install Python from https://www.python.org/downloads/
  2. From this page itself, click on the "Clone or download" button and then click on "Download ZIP".
  3. Extract the zip.
  4. Open Command Prompt (CMD) and navigate to the folder where the ZIP file has been extracted using cd command. For more help : https://www.youtube.com/watch?v=sjaCgavMO18
  5. Once you are in that folder, copy and paste python galton.py 15 200 command into the Command Prompt. 15 is the number of levels (height) of the board and 200 is the number of balls that would be used for the simulation. You may use any positive whole number for those 2 values.

How to use (programmers)

Windows

  1. Just follow the step 5 from the previous explanation.

Linux

  1. In Terminal use the python3 galton.py [height] [balls] command were height and balls are integer values.

Output example:

0

0

1
.
12
............
34
..................................
46
..............................................
71
.......................................................................
56
........................................................
50
..................................................
34
..................................
13
.............
2
..
2
..
0

galton-board-py-v2's People

Contributors

anishsatalkar avatar jaime02 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.