Anonymous user
Galton box animation: Difference between revisions
m
removed redunatant URL, added a ;Task: and ;Task requirements: section headers.
m (→{{header|REXX}}: simplified code, optimized execution, added/changed whitespace and comments.) |
m (removed redunatant URL, added a ;Task: and ;Task requirements: section headers.) |
||
Line 2:
[[Category:Randomness]]
{{omit from|GUISS}}
Generate an animated simulation of [[wp:Bean_machine|Sir Francis Galton's device]]. ▼
▲An example can be found to the right. [[File:Galtonbox-Unicon.PNG|thumb|Example of a Galton Box at the end of animation.]]
▲Generate an animated simulation of [[wp:Bean_machine|Sir Francis Galton's device]].
A number of balls are dropped so that they fall in line with the top pin, deflecting to the left or the right of the pin. The ball continues to fall to the left or right of subsequent pins before arriving at one of the collection points between and to the sides of the bottom row of pins. ▼
Your solution can use graphics or ASCII animation. ▼
Provide a sample of the output/display such as a screenshot.▼
▲In a Galton box, there are a set of pins arranged in a triangular pattern. A number of balls are dropped so that they fall in line with the top pin, deflecting to the left or the right of the pin. The ball continues to fall to the left or right of
Your solution can have either one or more balls in flight at the same time. ▼
If multiple balls are in flight, ensure they don't interfere with each other.▼
Your solution should allow users to specify the number of balls or it should run until full or a preset limit. Optionally, display the number of balls.▼
;Task:
Generate an animated simulation of a Galton device.
;Task requirements:
::* The box should have at least 5 pins on the bottom row.
▲::* Provide a sample of the output/display such as a screenshot.
▲::* If multiple balls are in flight, ensure they don't interfere with each other.
▲
::* Optionally, display the number of balls.
<br><br>
=={{header|AutoHotkey}}==
|