mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-06-29 09:48:22 -07:00
8495e59a8f
Avoid executing code on module level as this prevents importing the module for testing. Especially infinite loops are evil.
Bullseye
In this game, up to 20 players throw darts at a target with 10-, 20-, 30-, and 40-point zones. The objective is to get 200 points.
You have a choice of three methods of throwing:
| Throw | Description | Probable Score |
|---|---|---|
| 1 | Fast overarm | Bullseye or complete miss |
| 2 | Controlled overarm | 10, 20, or 30 points |
| 3 | Underarm | Anything |
You will find after playing a while that different players will swear by different strategies. However, considering the expected score per throw by always using throw 3:
| Score (S) | Probability (P) | S x P |
|---|---|---|
| 40 | 1.00-.95 = .05 | 2 |
| 30 | .95-.75 = .20 | 6 |
| 30 | .75-.45 = .30 | 6 |
| 10 | .45-.05 = .40 | 4 |
| 0 | .05-.00 = .05 | 0 |
Expected score per throw = 18
Calculate the expected score for the other throws and you may be surprised!
The program was written by David Ahl of Creative Computing.
As published in Basic Computer Games (1978):
Downloaded from Vintage Basic at http://www.vintage-basic.net/games.html
Porting Notes
(please note any difficulties or challenges in porting here)