Welcome, Class of 2018!

This site is where our weekly goals, homework and programming tasks will be posted.

Make sure you bookmark it!

Your task for our second double period, leading into holiday homework, is as follows:

1. Build a “magic eight-ball” program that will respond with random predictions when asked a question.

Here is a sample:

Hello! I'm a magic eight ball! What's your name?
Your Name: Nina
Welcome, Nina! Please ask your question!
Your Question: Do you like pie?
Your question was:
Do you like pie?
My response is: Most likely.
Would you like to ask another question? (y/n)

TIP: Remember to use a while loop so the eight-ball asks if you’d like to ask another question. You will also need to use the random package (import random) that was demonstrated to you in class.

2. Extension: Write a ‘choose your own adventure’ game, where players are presented with a scenario and then given options at each turn to choose their path.

  • Example:

    You are on a planet full of dragons. In the north and east you see two caves. In one cave, the dragon is friendly and will share his treasure with you. The other dragon is greedy and hungry, and will eat you on sight.
    Which cave will you go into? (north or east)
    > north
    You approach the northern cave...
    It is dark and spooky...
    A large dragon jumps out in front of you! He opens his jaws and...
    gobbles you down in one bite!
    Do you want to play again? (yes or no)
    > no

    The first program is due first week back – if you get stuck, send me an email!