CSCI 1300
Project: Pegboard Pinball

This is one of several possible projects for CSCI 1300. The following link tells how the projects are used:


What the Program Should Do

This project involves a simulation of a simple game probably everyone has seen.

The game involves dropping a ball through a vertical playing board which contains several horizontal pegs. The user can choose the location from which to drop the ball. The pegs are placed so that there is no way the ball can drop through the board without hitting some of the pegs. When a ball hits a peg, it bounces to the right or to the left. The selection of the direction of the bounce is controlled by a probability, say the probability of bouncing right ( where, probability of bouncing left = ( 1 - probability of bouncing right ) ). This probability should be set as a global constant or read as input data, so that the probability can be easily changed in order to assess the effect of this probability on the outcome of the game.

After several bounces the ball emerges from the playing board and falls into one of several containers. Each container has been assigned a value. A player is given a limited number of balls to drop. The score earned by each ball is the value of the container in which it is found. The total score for a game is calculated by summing these individual ball scores over all the balls used.

Estimated Difficulty Level for First Semester Students:


On a scale of 50 (easy) to 500 (hard): 300