[SOLVED] IS415 - Assignment 2

35.00 $

Category:

Description

5/5 - (1 vote)

IS 415/615
Assignment
File Input/Output and Functions
In this assignment, you will write small game called traveller.py. The purpose of this game is travel along path.
The player starts at position and needs move position The current position the path must stored as csv data in file called road. Think of each position the path as being between the commas of the csv file. The player will represented in this file as
The player starts with 100 health, which must stored in file called health. [IS 615 only] The player starts with potion, which must stored in file called
inventory.
Your program will need take dynamic user input using the input() function. Each user provides input, this is considered single turn. The user provide of valid inputs: for roll the dice, for consume potion, and q quit.
When the dice is rolled, of outcomes will occur:
Take damage Take step backwards Pray for salvation and roll d10 saved. If the roll is equal send the
player the end of the path. Otherwise nothing.
Take damage [IS 615 only] Double your next movement (forward back). [IS 415]
nothing.
Take step forward
[IS 615 only] When the potion is selected, restore up health (100 is full health), and the potion is empty and cannot reused.
You must not maintain information in variables between turns. Everything that you need remember must stored in the files: road, health and inventory.
You will need write many functions create this game. Each action should stored in function. For example, getting the current position the road should performed by function that returns list that contains the information stored in the road file.
The current health and current position the road should shown the user every turn.
The player cannot move beyond the edges of the road, positions and Being at position is the condition.
Assignment
IS 415/615
The outcome of each dice roll should shown the user. Below is example game:
>python traveller.py Your current health is: 100 | | | | | | | | Your journey begins. You only at the first position.
What will you traveller? You rolled You took damage Your current health is: | | | | | | | |
What will you traveller? You rolled You took damage Your current health is: | | | | | | | |
What will you traveller? You rolled Double your next movement Your current health is: XX| | | | | | | | |
What will you traveller? You rolled You moved forward Your current health is: | | | | | | |
What will you traveller? You rolled Nobody heard your prayers Your current health is: | | | | | | |
What will you traveller? You rolled You moved back Your current health is: | | | | | | |
What will you traveller? You rolled You took damage Your current health is: | | | | | | |
What will you traveller? You rolled Double your next movement Your current health is: |XX| | | | | | | |
What will you traveller? You rolled You took damage Your current health is: |XX| | | | | | | |
What will you traveller? You rolled You took damage Your current health is: |XX| | | | | | | |
What will you traveller? You consumed your potion Your current health is: |XX| | | | | | | |
What will you traveller? You rolled You moved forward Your current health is: | | | | | | |
What will you traveller? You rolled
You moved forward Your current health is: | | | | | | |
What will you traveller? You rolled Double your next movement Your current health is: | | | |XX| | | | |
What will you traveller? You rolled Double your next movement Your current health is: | | | |XXXX| | | | |
What will you traveller? You rolled Nobody heard your prayers Your current health is: | | | |XXXX| | | | |
What will you traveller? You rolled You moved forward Your current health is: | | | | | | |
What will you traveller? You rolled You took damage Your current health is: | | | | | | |
What will you traveller? You rolled You moved forward You made it the end of the road. Well done. You
Assignment
IS 415/615
If the player inputs something other than q, print the possible inputs and wait for another user input.
If the player rolls and then subsequently rolls they moved position and
The potion only consumed once:
Assignment
IS 415/615
If the player runs of health, they and the game is over:
Both IS 415 and IS 615 students will submit just the traveller.py file. The contents of the file for IS 615 students will complex handle the additional game mechanics.