awacke1 commited on
Commit
f86966c
·
1 Parent(s): ab1cbaa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -14
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
- while True:
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__":
 
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__":