BINGO is a game of chance in which each player matches numbers printed in different arrangements on 5×5 cards which the numbers the game host (caller) draws at random, marking the selected numbers with tiles.
The game is won when a player marks their board in a specific pattern, usually a straight line horizontally, vertically, or diagonally across five spaces. Don't forget to yell "BINGO!"
We are going to split this out into mini-chalenges.
Using classic BINGO spaces (B-I-N-G-O 1-75), generate BINGO cards. Don't forget about the free space in the center of the card! The card is a 5x5 grid with column headings of B, I, N, G and O. There are a total of 75 possible numbers that can be filled into the grid, but placement is not entirely random. Each letter column corresponds to a set of 15 numbers as follows:
B) 1 - 15
I) 16 - 30
N) 31 - 45
G) 46 - 60
O) 61 - 75
Did you know that MacOS includes a command, say
, that will verbalize commands. Use this functionality to create a caller that will call out BINGO spaces.
Create a fully functioning BINGO game that generates a board, calls spaces, and allows users to mark the spaces as they are called. Make an AI version that marks the board for you.
You can build this as a web app or a terminal app.
Once you have created your classic boards, try allowing board generation using a custom list. You can allow users to input the list themselves (maybe as an array), or find a set of data (for example, "US Cities") to pass to your application.
The classic game is won when a player marks a line of 5 spaces either horizontally, vertically, or diagonally. What other patterns can you use to get a winner? Here are some options:
X Pattern
Diamond
Plus
Pyramid (can be from any edge)
Postage Stamp (can be from any corner)