Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -59,7 +59,13 @@ def generate_board():
|
|
59 |
|
60 |
# Display sidebar buttons and handle user input
|
61 |
st.sidebar.button("Load Word List", on_click=load_word_list)
|
62 |
-
st.sidebar.button("Save Word List", on_click=save_word_list)
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
if st.sidebar.button("Generate Board"):
|
64 |
# Get words from word list textbox
|
65 |
words = st.text_area("Enter a list of words (one per line)", "\n".join(words)).split("\n")
|
@@ -67,7 +73,16 @@ if st.sidebar.button("Generate Board"):
|
|
67 |
st.sidebar.subheader("Word List:")
|
68 |
for i, word in enumerate(words):
|
69 |
st.sidebar.write(f"{i+1}. {word}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
|
71 |
-
# Display letter board
|
72 |
st.write("Word Search Board:")
|
73 |
-
st.table(board)
|
|
|
59 |
|
60 |
# Display sidebar buttons and handle user input
|
61 |
st.sidebar.button("Load Word List", on_click=load_word_list)
|
62 |
+
if st.sidebar.button("Save Word List", on_click=save_word_list):
|
63 |
+
# Get words from word list textbox
|
64 |
+
words = st.text_area("Enter a list of words (one per line)", "\n".join(words)).split("\n")
|
65 |
+
# Update word list on sidebar
|
66 |
+
st.sidebar.subheader("Word List:")
|
67 |
+
for i, word in enumerate(words):
|
68 |
+
st.sidebar.write(f"{i+1}. {word}")
|
69 |
if st.sidebar.button("Generate Board"):
|
70 |
# Get words from word list textbox
|
71 |
words = st.text_area("Enter a list of words (one per line)", "\n".join(words)).split("\n")
|
|
|
73 |
st.sidebar.subheader("Word List:")
|
74 |
for i, word in enumerate(words):
|
75 |
st.sidebar.write(f"{i+1}. {word}")
|
76 |
+
generate_board()
|
77 |
+
|
78 |
+
# Display word list text box and "Save Word List" button
|
79 |
+
words = st.text_area("Enter a list of words (one per line)", "\n".join(words))
|
80 |
+
if st.button("Save Word List"):
|
81 |
+
words = words.split("\n")
|
82 |
+
save_word_list()
|
83 |
+
st.sidebar.subheader("Word List:")
|
84 |
+
for i, word in enumerate(words):
|
85 |
+
st.sidebar.write(f"{i+1}. {word}")
|
86 |
|
|
|
87 |
st.write("Word Search Board:")
|
88 |
+
st.table(board)
|