aashwinik commited on
Commit
e52a895
·
verified ·
1 Parent(s): 98abc44

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -10,7 +10,7 @@ if "Value" not in st.session_state:
10
 
11
 
12
  def get_userInput():
13
- input = st.text_input("Enter a number between 1 to 9 to mark " + st.session_state.Value, key="input")
14
  return input
15
 
16
  def validate_userInput(user_input):
@@ -125,15 +125,16 @@ st.set_page_config(page_title="Python - Tic Tac Toe", page_icon=":python:")
125
  st.header("Python - Tic Tac Toe")
126
  display_guide()
127
 
 
 
128
  #UI Buttons
129
  submit=st.button('Submit')
130
  #replay=st.button('Replay')
131
 
132
  #Button functionality
133
- if submit:
134
- user_input=get_userInput()
135
- response=validate_userInput(user_input)
136
- if response:
137
  update_legalNumbers(user_input)
138
  display_board(user_input)
139
  else:
 
10
 
11
 
12
  def get_userInput():
13
+ input = st.number_input("Enter a number between 1 to 9 to mark " + st.session_state.Value,min_value=1,max_value=9, key="int", on_change=None)
14
  return input
15
 
16
  def validate_userInput(user_input):
 
125
  st.header("Python - Tic Tac Toe")
126
  display_guide()
127
 
128
+ user_input=get_userInput()
129
+
130
  #UI Buttons
131
  submit=st.button('Submit')
132
  #replay=st.button('Replay')
133
 
134
  #Button functionality
135
+ if submit:
136
+ valid=validate_userInput(user_input)
137
+ if valid:
 
138
  update_legalNumbers(user_input)
139
  display_board(user_input)
140
  else: