Buzzword bingo (also known as bullshit bingo) is a game that finally achieved wild popularity on 22 February 1994, when it was featured in a Dilbert comic strip in which the characters play during an office meeting.

Dilbert buzzword bingo

Buzzword bingo is generally played in situations where audience members feel that the speaker, in an effort to mask a lack of actual knowledge, is relying too heavily on buzzwords rather than providing relevant details. Lectures by boring professors or business meetings led by guest speakers or notable company personalities from higher up the pay scale are often viewed as a good opportunity for buzzword bingo, as the language used by these speakers often includes predictable references to arcane concepts, which are perfect for use in the creation of buzzword bingo cards. The idea is that each participant prepares a list of stop words or buzzwords that he expects the speaker will use. These words are written on a bingo card containing a square grid of $$n$$ rows and $$n$$ columns ($$n \in \mathbb{N}$$). For example, the following bingo card could be used to play buzzword bingo in a lecture about genetics.

buzzword bingo

A participant may tick off a word on his card if it is uttered by the speaker. The goal of the game is to tick off all words in a given row or column, and then yell "Bingo!". Having the courage to actually yell "Bingo!" is an important element of the game. In order to avoid the reprimands that would likely result from doing so, participants may resort to looking at one another and silently mouthing the word "Bingo". An alternate variation requires the person who has achieved bingo to raise his or her hand and use the word "Bingo" within the context of a comment or question.

Assignment

Write a class BuzzBingo that can be used to instantiate objects that represent the bingo card as used in a buzzword bingo game. The objects of the class BuzzBingo must at least support the following methods.

Example

>>> bingo = BuzzBingo(4, [
...    'cell', 'bacteria', 'PCR', 'virus', 
...    'allele', 'chromosome', 'DNA', 'meiosis', 
...    'protein', 'phenotype', 'gene', 'mutation',
...    'genome', 'recessive', 'RNA', 'mitosis'
... ])
>>> bingo
----
----
----
----
>>> bingo.won()
False

>>> bingo.cancelWord('phenotype')
(2, 1)
>>> print(bingo)
----
----
-x--
----
>>> bingo.won()
False

>>> bingo.cancelWord('dominant')
Traceback (most recent call last):
AssertionError: dominant not found on card

>>> bingo.cancelWord('phenotype')
Traceback (most recent call last):
AssertionError: phenotype was already cancelled

>>> bingo.cancelWords(['PCR', 'chromosome', 'protein'])
[(0, 2), (1, 1), (2, 0)]
>>> bingo
--x-
-x--
xx--
----
>>> bingo.won()
False

>>> bingo.cancelWords(('recessive', 'bacteria', 'mitosis'))
[(3, 1), (0, 1), (3, 3)]
>>> print(bingo)
-xx-
-x--
xx--
-x-x
>>> bingo.won()
True

>>> bingo = BuzzBingo(2, ('cell', 'bacteria', 'PCR'))
Traceback (most recent call last):
AssertionError: invalid card
>>> bingo = BuzzBingo(2, ['cell', 'bacteria', 'PCR', 'virus', 'allele'])
Traceback (most recent call last):
AssertionError: invalid card