Watching the Olympics, I thought it would be cool to simulate a race with ActionScript. Below is my first version of the ActionScript Olympic Race, where each colored circle has an equal chance at winning. The script features a Math.random() based algorithm that calculates the distance each circle will move as a Timer instance runs. Once a circle (a tie is possible) passes the finish line, the race ends, and that circle gets a notch in the win column.
See how many races it takes for each circle to have at least one win!
I’m hoping to polish this up before the actual Olympics end, maybe adding country flags and allowing you to give a country an edge. Suggestions are welcome and appreciated!