Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
Experiment.dart Added Dart version Dec 31, 2011
Game.dart
README.md Added README for Dart version Dec 31, 2011
Util.dart Added Dart version Dec 31, 2011
tosser.dart Added Dart version Dec 31, 2011
tosser.html Added Dart version Dec 31, 2011

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