a (very)
short Interactive fiction
Summary:
Once upon a time, when processors were slow, and
graphical displays were expensive or non-existent, computer games were
mostly text. The game told a story and the player was able to influence
the outcome of that story. Then computer games gained graphics and
controllers and these pure text games became called "interactive
fiction" and started to show up in English departments rather than
being something that computer science graduate students did to avoid
working on their Ph.D dissertations.
In this project you will program a very short interactive fiction
program of your own. Oh and you'll get a chance to practice your if
statements, functions and parameter passing too.
Due: Tuesday Nov 10th at 11:59pm
Details:
You will need to write the functions defined below.
- print_story_segment(string):
- this function should take a string representing part of a story
and print it. *this
is the only function allowed to print in your final version*
- start_story
- startStory should print the beginning of your story (using
print_story_segment) to the user
and then ask the user to choose one of two choices, (based on your
story) if the user chooses the first choice, call he choiceOne
method,
If the user chooses the second choice, choose the choiceTwo
method.
- choice_one:
- should print (using print_story_segment) part of the story and
give the user two more choices, based on these choices it should
call either ending_one or ending_two and use print_story_segment
to print the return value of the ending your user chose.
- choice_two
- works like choice_one except with a different story segment.
- ending_one
- return the string with the appropriate ending to the story
- ending_two
- return the string with the appropriate ending to the story
- ending_three
- return the string with the appropriate ending to the story
- ending_four
- return the string with the appropriate ending to the story
- The main method should look like the one below, you may not have
more than three lines in the main method
def main():
startStory();
Continue to implement the methods in this way (first some story printed
out then a choice, which will call one method for choice one and
another method for choice two) following the flow chart below. Note
that only the StartStory, ChoiceOne and ChoiceTwo methods need if
statements. The rest of them (Ending One-Four) just need
System.out.print statements to tell the story.
Submitting:
again zip up your project folder and submit it to me by blackboard
Make
sure that your submitted zip file
contains your first initial and last name as part of the zip file
name.