CPS 280S
Alternative Programming Languages
9/19/19
Problem Three - 50 points
I. Objective
This problem lets you practice using data structures, loops, and variables.
II. Assignment
Write a Python program that plays a game of bingo.
III. Detailed Instruction
A bingo card is a 5x5 grid of numbers with the center position being a free space. The first column (B) has numbers between 1-15, the second column (I) has numbers between 16-30, and the final column (O) has numbers between 61-75. The balls range from 1-75 and are drawn one at a time without replacement. A player has to be the first to match a predefined pattern.
Write a program that generates a bingo card following the specifications above and plays bingo until the bingo is hit. For each draw, print the marked bingo card and what ball was drawn. Once the bingo hits, print the number of balls it took to get the bingo.
IV. Sample Output
Ball drawn: B10
[4, 10, 6, 2, 9, 21, 22, 27, 16, 23, 31, 44, *, 36, 41, 58, 56, 57, 50, 60, 64, 72, 71, 68, 74]
[0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Ball drawn: O68
[4, 10, 6, 2, 9, 21, 22, 27, 16, 23, 31, 44, *, 36, 41, 58, 56, 57, 50, 60, 64, 72, 71, 68, 74]
[0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
V. Submission
Submit the Python files to Blackboard on or before the deadline by 11:59 PM.