awacke1 commited on
Commit
3fe30b9
·
verified ·
1 Parent(s): 2f3379a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -64,17 +64,21 @@ def main():
64
  col1, col2, col3 = st.columns(3)
65
  with col1:
66
  if st.button("West"):
67
- st.session_state.locations = move_emojis(st.session_state.locations, current_location, "West")
68
  with col2:
69
  if st.button("North"):
70
- st.session_state.locations = move_emojis(st.session_state.locations, current_location, "North")
71
  if st.button("Stop"):
72
- pass
73
  if st.button("South"):
74
- st.session_state.locations = move_emojis(st.session_state.locations, current_location, "South")
75
  with col3:
76
  if st.button("East"):
77
- st.session_state.locations = move_emojis(st.session_state.locations, current_location, "East")
 
 
 
 
78
 
79
  if __name__ == "__main__":
80
  main()
 
64
  col1, col2, col3 = st.columns(3)
65
  with col1:
66
  if st.button("West"):
67
+ direction = "West"
68
  with col2:
69
  if st.button("North"):
70
+ direction = "North"
71
  if st.button("Stop"):
72
+ direction = "None"
73
  if st.button("South"):
74
+ direction = "South"
75
  with col3:
76
  if st.button("East"):
77
+ direction = "East"
78
+
79
+ if direction != "None":
80
+ st.session_state.locations = move_emojis(st.session_state.locations, current_location, direction)
81
+ st.experimental_rerun()
82
 
83
  if __name__ == "__main__":
84
  main()