Update app.py
Browse files
app.py
CHANGED
|
@@ -69,14 +69,15 @@ if sidebar_option == "Introductory Tutorial":
|
|
| 69 |
|
| 70 |
# Get input array from user
|
| 71 |
user_input = st.text_input("Enter the array elements separated by spaces:")
|
|
|
|
| 72 |
if user_input:
|
| 73 |
arr = list(map(int, user_input.split()))
|
| 74 |
|
| 75 |
# Ask the user if they want an animation
|
| 76 |
-
animate_option = st.radio("Do you want to see the animation?",
|
| 77 |
-
|
| 78 |
-
|
| 79 |
# Perform bubble sort and get the steps for animation
|
|
|
|
| 80 |
sorted_array, steps = bubble_sort(arr, animate)
|
| 81 |
|
| 82 |
# Display the sorted array
|
|
|
|
| 69 |
|
| 70 |
# Get input array from user
|
| 71 |
user_input = st.text_input("Enter the array elements separated by spaces:")
|
| 72 |
+
|
| 73 |
if user_input:
|
| 74 |
arr = list(map(int, user_input.split()))
|
| 75 |
|
| 76 |
# Ask the user if they want an animation
|
| 77 |
+
animate_option = st.radio("Do you want to see the animation?", options=["Yes", "No"])
|
| 78 |
+
|
|
|
|
| 79 |
# Perform bubble sort and get the steps for animation
|
| 80 |
+
animate = animate_option == "Yes"
|
| 81 |
sorted_array, steps = bubble_sort(arr, animate)
|
| 82 |
|
| 83 |
# Display the sorted array
|