Question: Overview This assignment will require you to combine your knowledge of conditionals and loops by writing your own adventure game! The premise of the game
Overview
This assignment will require you to combine your knowledge of conditionals and
loops by writing your own adventure game! The premise of the game is simple. You
are a brave adventurer exploring a castle full of unknowns in search of treasure. At
each step you must choose where to visit next. But be careful...surprises await!
The Assignment
The structure of the program is simple. The player starts at the entrance to the
castle. They are then asked what room they would like to visit. When they visit that
room, a brief description of the room and what they found there is printed, and then
they are asked to choose another room to visit next. If they player chooses to visit
the exit, then the game ends. Similarly, if the player finds the treasure in a room, the
game ends. You may have as many rooms as you like, within the following
constraints:
You must have at least rooms
Not every room is reachable from every other room.
Some backtracking must be allowed.
The game must have several alternative endings.
So basically, the program is a large loop with several conditionals corresponding to
the room to be visited, which each of those conditionals handling what happens in
each room.
Because the world is a scary place, and nobody lives forever, you will also
incorporate a random number generator that will give you a small probability of death
at any step. A random number can be simulated with a call to random.randint
which generates a uniform random number in If you assume values
mean death, then you will have a chance of dying. You can change these odds
to whatever you like. Make sure to import the random module ie import random
This assignment is purposefully open ended. Be creative and have fun!
Getting Started
Not sure where to begin? Review How to Approach Programming Assignments.
For this project, it would probably be easiest to start with the main game loop and a
small handful of rooms, testing that it's possible to win the game. Then implement
Complement: Write a module,
complement.py with a function, complement, that
returns the complement of a DNA string given as input. Also provide a function,
revcomplement that takes a DNA sequence as string input and returns the reverse
complement of the sequence as a string. Recall that the valid alphabet is
and that AT and GC are complements. A reverse complement is found by reversing
the input string and replacing every nucleotide with its complement. This means that
your revcomplement function should use your complement function internally rather
than duplicating code. Your functions should do appropriate error checking and return
an error message as appropriate. Test your functions with input from the user.
For example, if your input is ACTG, your complement should be TGAC and your
reverse complement should be CAGT.
YOU ARE NOT ALLOWED TO USE A DICTIONARY.
Stats: Write a program that continually prompts the user for positive integer values and
stores them in a list. You should stop prompting when the user enters a negative
integer value the negative value should not be stored
When the user is done entering values, you should print the list of integers they have
provided in sorted order. You should then compute the mean and standard deviation of
the values in the list.
Recall that the mean is just the arithmetic average...the sum of all the values divided by
the number of values. In mathematics notation we represent the mean with the Greek
letter
In statistics, standard deviation is the square root of variance and measures how much,
on average, values deviate from the mean. So consider a list of numbers, with mean
:
Variance where is the value at position in the list.
Standard Deviation ariance
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
