Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Import the random Module
- import random
- # Here are your list of Pirates
- pirates = [
- 'Captain William Kidd',
- 'Pierre Le Grand',
- 'Red Leg Grieves',
- 'Edward Low',
- 'Calico Jack Rackham',
- 'Anne Bonny',
- 'Captain Henry Morgan',
- 'Black Sam Bellamy',
- 'Black Bart Roberts',
- 'Edward Blackbeard Teach']
- # PRINT THE CONTENT OF THE PIRATES LIST TO THE SCREEN HERE
- print(pirates)
- # Attacks List
- attack = ['dodge', 'parry', 'thrust']
- # PRINT THE CONTENTS OF THE ATTACK LIST TO THE SCREEN HERE
- print(attack)
- # Choosing the Characters for the fight
- player = random.choice(pirates)
- opponent = random.choice(pirates)
- # #############################################################################
- # Change the line below to correctly concatenate PLAYER and OPPONENT with
- # the variables above so that when the statement prints to screen, the chosen
- # character names are shown.
- # #############################################################################
- print("Ahoy ye swabs! Prepare for battle!")
- print(player + " has challenged " + opponent + " in one on one combat!")
- # Choosing the attack
- pattack = random.choice(attack)
- oattack = random.choice(attack)
- # CREATE A CORRECTLY CONCATENATED STRING THAT CONTAINS PLAYER, OPPONENT, PATTACK & OATTACK
- print(player + " uses " + pattack + " and " + opponent + " uses " + oattack)
- if pattack == oattack:
- print("It's a draw.")
- elif pattack == "dodge" and oattack == "parry":
- print(player + " won the match.")
- elif pattack == "parry" and oattack == "thrust":
- print(player + " won the match.")
- elif pattack == "thrust" and oattack == "dodge":
- print(player + " won the match.")
- elif oattack == "dodge" and pattack == "parry":
- print(opponent + " won the match.")
- elif oattack == "parry" and pattack == "thrust":
- print(opponent + " won the match.")
- elif oattack == "thrust" and pattack == "dodge":
- print(opponent + " won the match.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement