Skip to content

Commit

Permalink
Get all words > 7 chars
Browse files Browse the repository at this point in the history
  • Loading branch information
elmoiv authored Feb 25, 2020
1 parent 496e3bf commit 9bb0c05
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions battletext.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ def get_words(letter, skipped, length):

def smart_randomizer(words:list, randomized=True):
global word_history

# Toggle between human like typing and auto-robot
new_list = words[:]

# Get all words larger than 7 chars
new_list = list(filter(lambda i: len(i) > 7, new_list))
random.shuffle(new_list)

if not randomized:
new_list = words[:]

Expand All @@ -48,7 +51,6 @@ def smart_randomizer(words:list, randomized=True):

def on_click(x, y, button, pressed):
global current_position

# If mouse clicked store position and stop listener
if pressed:
current_position = (x, y)
Expand Down Expand Up @@ -176,3 +178,4 @@ def main():

if __name__ == '__main__':
main()
input()

0 comments on commit 9bb0c05

Please sign in to comment.