Solutions to the problems from Chapter 5
For rthis one, simply add your solutions to the repository. There aren't really any sources necessary.
Here is a breakdown of the assignments:
-
Create a program that prints a list of words in random order. The program should print all the words and not repeat any.
-
Write a Character Creator program for a role-playing game. The player should be given a pool of 30 points to spend on four attributes: Strength, Health, Wisdom, and Dexterity. The player should be able to spend points from the pool on any attribute and should also be able to take points from an attribute and put them back into the pool.
-
Write a Who’s Your Daddy? program that lets the user enter the name of a male and produces the name of his father. (You can use celebrities, fictional characters, or even historical figures for fun.) Allow the user to add, replace, and delete sonfather pairs.
-
Improve the Who’s Your Daddy program by adding a choice that lets the user enter a name and get back a grandfather. Your program should still only use one dictionary of son-father pairs. Make sure to include several generations in your dictionary so that a match can be found.