CSC207 - Project 2
Geography Game

Assigned Oct 14th
Due October 23 Midnight


Overview

For this project, we will explore more complex interactions with the user by implementing control statements and loops. We will create a program for one user to play the Geography word game.

In particular, this project will cover the following concepts we have discussed in class:

Description

To play the Geography game, two players alternately say the names of a country in the world. There are a few restrictions. A player must respond by saying the name of a country where the first letter matches the last letter of the country said by the other player. Also, once a country name is chosen, it cannot be used again. The first player to be stumped loses the game.

You will program this game for a user to play against a computer opponent. An example game is as follows:

User: Botswana
Computer: Algeria
User: Afganistan
Computer: Norway
User: Yemen
Computer: Nigeria
User: Angola
Computer: Albania
User: I GIVE UP
Computer: I Win! You could have said Austria.

Computer Players

You will program three types of computer players, and the user will choose the difficulty of each game they play.

Coding

For this assignment we will be writing a Python program to let a user repeatedly play Geography against the computer.

You must create a python program called geography.py. It will:

  1. Tell the user about the game.
  2. Ask the user what level of difficulty, EASY, MEDIUM or HARD.
  3. Have the user type in a country name.
  4. Have the computer respond according to its strategy.
  5. Repeat playing the game between the user and computer until either the computer is stumped or the user gives up by typing "I GIVE UP".
  6. If the user gave up prematurely, have the computer display a country that would have worked.
  7. When the game is over, ask the user if they would like to play again. If so, start all over.

Your code should make good use of functions, as there are clear pieces of the game which are repeated. Using functions will reduce the amount of code you need to write as well as make your program easier to debug. However, do not write spaghetti code, where functions call each other back and forth to continue execution of the program; let your functions naturally return values and use loops to repeat the game turns.

Your code must check all user input for validity and reprompt them for correct input if any mistakes are made.

What to Hand In

Log in to cs.centenary.edu through either Secure FTP or WinSCP using your cs login and password. Copy your geography.py project into the project2 directory, along with any other files you need to run your code. Make sure you have followed the Python Style Guide, and have run your project through the Automated Style Checker.

You must hand in:

and any other files necessary to run your code.
© Mark Goadrich, Centenary College of Louisiana