Created
January 7, 2016 07:41
-
-
Save codeboy101/369837d306977ff788b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#F1 see this : | |
# wordWars my version : | |
loadAmmo = input("enter your word seperated by a space : ") #taking in words | |
new = loadAmmo.split(' ') # splitting em | |
redTeam = new[0] ## assigning straightaway because we know there are only going to be 2 words | |
blueTeam = new[1] | |
blueAmmo = [] # arrays for unique letters or characters for each team | |
redAmmo = [] | |
[blueAmmo.append(letter) for letter in blueTeam if letter not in redTeam] # common wors blow up and unique ones are appended | |
[redAmmo.append(letter) for letter in redTeam if letter not in blueTeam] | |
if len(blueAmmo) > len(redAmmo) : #final check for winner | |
print("Blue Team has more firepower . Blue Wins !") | |
elif len(redAmmo) > len(blueAmmo) : | |
print("Red Team has more firepower . Red Wins !") | |
elif len(blueAmmo) == len(redAmmo) : | |
print("It's A Tie") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment