Update app.py
Browse files
app.py
CHANGED
@@ -9,16 +9,10 @@ def download():
|
|
9 |
nltk.download('words')
|
10 |
download()
|
11 |
|
12 |
-
|
13 |
-
|
14 |
five_letters = [word for word in words.words() if len(word)==5 ]
|
15 |
|
16 |
-
# create a five column grid
|
17 |
-
|
18 |
[a,b,c,d,e] = st.columns(5)
|
19 |
|
20 |
-
# get user input currently doesnt handle number of characters
|
21 |
-
|
22 |
with a:
|
23 |
first_letter = st.text_input(label="1st",value = 'a')
|
24 |
with b:
|
@@ -30,33 +24,19 @@ with d:
|
|
30 |
with e:
|
31 |
fifth_letter = st.text_input(label="5th", value = 't')
|
32 |
|
33 |
-
# combine all the letters
|
34 |
-
|
35 |
clue = first_letter+second_letter+third_letter+fourth_letter+fifth_letter
|
36 |
|
37 |
st.markdown("### clue")
|
38 |
-
|
39 |
st.write(clue)
|
40 |
-
|
41 |
st.markdown("### Exclusion letters")
|
42 |
-
|
43 |
-
# exclusion letters where the grey grids are
|
44 |
-
|
45 |
exclusions = st.text_input(label="exclusions")
|
46 |
-
|
47 |
st.markdown("# Wordle Clues")
|
48 |
|
49 |
-
|
50 |
-
# this is an empty list to show all the clue words
|
51 |
-
|
52 |
clue_result = []
|
53 |
|
54 |
-
|
55 |
for word in five_letters:
|
56 |
if all(c in word for c in clue) and not any(c in word for c in exclusions):
|
57 |
clue_result.append(word)
|
58 |
|
59 |
-
# print the output list of clues
|
60 |
-
|
61 |
st.write(clue_result)
|
62 |
|
|
|
9 |
nltk.download('words')
|
10 |
download()
|
11 |
|
|
|
|
|
12 |
five_letters = [word for word in words.words() if len(word)==5 ]
|
13 |
|
|
|
|
|
14 |
[a,b,c,d,e] = st.columns(5)
|
15 |
|
|
|
|
|
16 |
with a:
|
17 |
first_letter = st.text_input(label="1st",value = 'a')
|
18 |
with b:
|
|
|
24 |
with e:
|
25 |
fifth_letter = st.text_input(label="5th", value = 't')
|
26 |
|
|
|
|
|
27 |
clue = first_letter+second_letter+third_letter+fourth_letter+fifth_letter
|
28 |
|
29 |
st.markdown("### clue")
|
|
|
30 |
st.write(clue)
|
|
|
31 |
st.markdown("### Exclusion letters")
|
|
|
|
|
|
|
32 |
exclusions = st.text_input(label="exclusions")
|
|
|
33 |
st.markdown("# Wordle Clues")
|
34 |
|
|
|
|
|
|
|
35 |
clue_result = []
|
36 |
|
|
|
37 |
for word in five_letters:
|
38 |
if all(c in word for c in clue) and not any(c in word for c in exclusions):
|
39 |
clue_result.append(word)
|
40 |
|
|
|
|
|
41 |
st.write(clue_result)
|
42 |
|