Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -109,20 +109,20 @@ def play_boggle(board, words):
|
|
109 |
with st.form(key="new_word"):
|
110 |
new_word = st.text_input("Enter a new word:")
|
111 |
submit_button = st.form_submit_button("Submit")
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
|
127 |
|
128 |
if __name__ == "__main__":
|
|
|
109 |
with st.form(key="new_word"):
|
110 |
new_word = st.text_input("Enter a new word:")
|
111 |
submit_button = st.form_submit_button("Submit")
|
112 |
+
|
113 |
+
if submit_button:
|
114 |
+
if len(new_word) >= 3 and new_word not in words and validate_word(new_word.upper(), board):
|
115 |
+
words.add(new_word)
|
116 |
+
st.write(f"Added {new_word} to the list of words!")
|
117 |
+
elif new_word in words:
|
118 |
+
st.write("Word already used!")
|
119 |
+
else:
|
120 |
+
st.write("Invalid word. Try again.")
|
121 |
+
st.write("Here are your words:")
|
122 |
+
st.write(words)
|
123 |
+
with st.form(key="new_word"):
|
124 |
+
new_word = st.text_input("Enter a new word:")
|
125 |
+
submit_button = st.form_submit_button("Submit")
|
126 |
|
127 |
|
128 |
if __name__ == "__main__":
|