SSC 1, 2010/2011 - Streams Exercise

Stream programming excercise: Buzzword Bingo

This exercise is a formative assessment: it will not count towards the final mark. You must demonstrate your solution to one of the demonstrators during the lab session in order to get feedback.

Buzzword Bingo is a game in which two players compete to find text that is full of buzzwords. (Inspired by the inventor of the internet, not to mention Algoreithms, Al Gore.) You can choose your own list of buzzwords, or use the sample buzzword file provided. Note that a buzzword can contain spaces. Each line counts as one buzzword.

Each player supplies an URL of a web page they choose. The program then connects to the URL and scans the web page for the keywords from the buzzword file. Every time the program finds an occurrence of one of those buzzwords, a score is updated and at the end, the player with the highest score wins.

To make it even easier, here are some example steps which would be necessary for creating this program:

Please note that this all that you are required to do. Below we supply some implementation ideas which aren't necessary for this exercise. They are there in case you finish the exercise faster and you wish to further experiment with streams.

Some optional implementation ideas

Once again, you are not required to follow these and we even urge you not to unless you are certain that you have fulfilled the minimum mandatory requirements for the exercise. If you did, and you would like to extend your knowledge on streams and regexps, the ideas below might inspire you.

Model solution

Simple model answer: BuzzBingoMultiple.java.