for HCC classes taught by Rylan Schubkegel
Due 11/27 at 11:59
Choose Your Own Adventure (CYOA) novels allow readers to make choices that impact the story. In this project, you will make your own CYOA game.
Your program must meet the following specifications:
text
: The text of this “page” of your “book”options
: A list of dictionaries with the following key/value pairs:
text
: The text displayed to the userpage
: The page number the user will go to next OR None
if this option ends the story.next
This is a great chance to flex your creative muscles 💪🏻 Have fun with it!!
Here is a simple example of a 2-page story dictionary (remember, yours must be at least 10 pages):
story = {
1: {
"text": "Hello, world! It's a great day for looping, don't you agree?",
"options": [
{
"text": "I agree 👍🏻",
"page": 1
},
{
"text": "I disagree 👎🏻",
"page": 2
}
]
},
2: {
"text": "Well, we can agree to disagree.",
"options": [
{
"text": "THE END",
"page": None
}
]
}
}
Hello, world! It's a great day for looping, don't you agree?
1) I agree!
2) I disagree!
>> 1
Hello, world! It's a great day for looping, don't you agree?
1) I agree!
2) I disagree!
>> 3
Invalid choice "3"
Hello, world! It's a great day for looping, don't you agree?
1) I agree!
2) I disagree!
>> 2
Well, we can agree to disagree.
1) THE END
>> 1
When your program meets the requirements, download and submit your .py
file here: