Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = 0
- score = 0
- count = 0
- f = str(raw_input("Filename? "))
- file = open(f + ".txt", "r")
- linecount = int(len(file.readlines()))
- file = open("mask.txt", "r") # Have to open again to go to beginning of file.
- for y in range(linecount): # Repeat for amount of lines, NOTE: End of file must have blank line(linebreak is a char)
- mask = file.readline()
- chars = len(mask)-1
- # Get number of chars in line and repeat adding until done then next line
- while n != int(chars):
- if str(mask[count]) == "l":
- score += 26
- count += 1
- n += 1
- if str(mask[count]) == "u":
- score += 26
- count += 1
- n += 1
- if str(mask[count]) == "d":
- score += 10
- count += 1
- n += 1
- if str(mask[count]) == "s":
- score += 33
- count += 1
- n += 1
- if str(mask[count]) == "a":
- score += 95
- count += 1
- n += 1
- if str(mask[count]) == "h":
- score += 16
- count += 1
- n += 1
- else:
- print score
- count = 0
- score = 0
- n = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement