2 Are you funnier than a hyena?

This chapter covers
- Creating a joke machine
- Creating a list of jokes for the joke machine
- Creating a GUI for the joke machine
- Using a button to display a random joke from the list
There is a well-known saying that “Laughter is the best medicine.” The original quote is not quite as catchy: “A merry heart doeth good like a medicine.” The point of the quote is still the same; laughing makes you feel good. It can make you feel happy and make you feel better. If a good story or joke made you laugh, you are likely to share the joke with others and spread the good medicine!
What you will build in this chapter
In this chapter, since laughter is the best medicine, you will build a Joke Machine (figure 2.1) to spread laughter all around. The Joke Machine consists of a simple button which, when pressed, will display a random joke. Don’t like the joke? Not a problem. Simply press the button again and a new joke will be displayed. As people tell you or you hear more jokes, you can collect them and add them to your Joke Machine so that it always makes people laugh. You will need four jokes to start with for this project, you can use the ones in this chapter and if you hear any good ones, write them down so that you can use them in this project.
Figure 2.1 The Joke Machine GUI
