Update app.py
Browse files90 unmodified lines9192939495969732 unmodified lines13013113213390 unmodified linesif state is None:state = (initialize_board(), -1, None, None, [])board, player, lu, la, history = statex, y = evt.indexcell = 400 // 8c, r = int(x // cell), int((y - cell * 2) // cell)32 unmodified linesnew_btn=gr.Button("New Game")img.select(click_handler,inputs=[state],outputs=[img,state])new_btn.click(fn=reset_handler,outputs=[state,img])demo.launch()90 unmodified lines91929394959697989910010132 unmodified lines13413513613790 unmodified linesif state is None:state = (initialize_board(), -1, None, None, [])board, player, lu, la, history = state# Handle evt.index callable vs attributeif callable(evt.index):x, y = evt.index()else:x, y = evt.indexcell = 400 // 8c, r = int(x // cell), int((y - cell * 2) // cell)32 unmodified linesnew_btn=gr.Button("New Game")img.select(click_handler,inputs=[state],outputs=[img,state])new_btn.click(fn=reset_handler,outputs=[state,img])demo.launch()
app.py+6-2