Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

..
Octocat-spinner-32 Experiment.dart
Octocat-spinner-32 Game.dart
Octocat-spinner-32 README.md
Octocat-spinner-32 Util.dart
Octocat-spinner-32 tosser.dart
Octocat-spinner-32 tosser.html
README.md

Simple coin tosser (Dart version)

Simulate the results of a coin toss experiment. If a coin lands heads you win a dollar, if it lands tails you lose a dollar.

Build and run using the Dart Editor.

And then open the file "tosser.html" in your web browser. Hit the "Run simulation" button with the default values.

This executes the program and yields something like the following chart, simulating 200 runs of 20 coin tosses. The chart shows the frequency of your net winnings after each run.

-13 
-12 *
-11 
-10 *******
-9  
-8  *******
-7  
-6  *****************
-5  
-4  *******************
-3  
-2  *************************
-1  
0   *********************************
1   
2   ******************************
3   
4   *****************************
5   
6   *******************
7   
8   ***********
9   
10  **
11  
12  
13  
Something went wrong with that request. Please try again.