- Joined
- Apr 5, 2012
- Messages
- 1,997
- Reaction score
- 826
Hello,
I am trying to make a text based game which you choose a possible outcome, it will roll a dice in the game and according to the number rolled it will show the outcome.
I stumbled across a problem when trying to show some outcomes.
I got the problem when I tried adding the second possible situation
The first lot of outcomes work
Here is my code:
Choice A works fine when I go to run it, but when i try to test running choice B the amount rolled by the dice with show option A aswell when just trying to show Dice roll B.
Please help!
I am trying to make a text based game which you choose a possible outcome, it will roll a dice in the game and according to the number rolled it will show the outcome.
I stumbled across a problem when trying to show some outcomes.
I got the problem when I tried adding the second possible situation
The first lot of outcomes work
Here is my code:
Code:
import random
print ("Welcome to Mission 1 of The Hitman Cheapolution")
print ("You are a in a alley in chinatown, no one is around you")
print ("Your target is the King of Chinatown")
print ("Your target walks under a crate full of wheels. You only have your fibre wire and the silver baller")
print ("A will shoot the rope holding the crate and it will crush him making you more awesome!")
print ("B will make you sneak up on him and strangle him with your fibrewire, ya sneak little thing")
choice = input ("So what will it be? Option 'A' or Option 'B':")
choice = "A"
roll = random.randint(1,20)
print("{0}".format(roll))
if roll <10:
print ("Oh no you missed your shot and your target spotted you. game over!")
if roll >11:
print ("Good shot, you killed your target and your awesome metre rose by 17!")
choice = "B"
roll = random.randint(1,20)
print("{0}".format(roll))
Choice A works fine when I go to run it, but when i try to test running choice B the amount rolled by the dice with show option A aswell when just trying to show Dice roll B.
Please help!