K0RB1 commited on
Commit
2cf9255
·
1 Parent(s): 1b0c915

i change again

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -4,7 +4,7 @@ import streamlit as st
4
  st.title("Welcome To Person Guessing Game!!")
5
  st.header("I will describe a person and you need to guess who it is by their characteristics")
6
 
7
-
8
 
9
  def guess():
10
  people = {
@@ -28,25 +28,24 @@ def guess():
28
  st.session_state.max_attempts = 5
29
 
30
  st.write(f"Here's the description for the person: {', '.join(st.session_state.description)}")
31
-
32
  a, b = st.columns(2)
33
- guess = st.radio("Who Do You Think It Is??",("Gian", "Kirby", "Francys", "JK", "Cielo", "Arki", "Mico", "Jhay"))
34
- st.write(f"Choose Here")
35
  submit = a.button("submit")
36
  clear = b.button("clear")
37
 
38
  if submit:
39
  if guess.lower() == st.session_state.chosen_name.lower():
40
  st.success(f"CONGRATULATIONS!!! YOU GUESSED IT CORRECTLY! IT IS {st.session_state.chosen_name}")
41
- st.stop() # Stop the app after a correct guess
42
 
43
  if st.session_state.attempts < st.session_state.max_attempts - 1:
44
  st.warning("That's Not Correct. Please Try Again.")
45
  else:
46
- st.error(f"Sorry, You're Out Of Attempts. The Correct Answer Was {st.session_state.chosen_name}")
47
- st.stop() # Stop the app after the game ends
48
 
49
- if clear:
50
  del st.session_state.choosen_name
51
  del st.session_state.description
52
  del st.session_state.attempts
 
4
  st.title("Welcome To Person Guessing Game!!")
5
  st.header("I will describe a person and you need to guess who it is by their characteristics")
6
 
7
+ st.write("Here Is Your Choices: Gian, Kirby, Francys, JK, Cielo, Arki, Basti, Mico, and Jhay.")
8
 
9
  def guess():
10
  people = {
 
28
  st.session_state.max_attempts = 5
29
 
30
  st.write(f"Here's the description for the person: {', '.join(st.session_state.description)}")
31
+
32
  a, b = st.columns(2)
33
+ guess = st.text_input("Who Do You Think It Is??")
 
34
  submit = a.button("submit")
35
  clear = b.button("clear")
36
 
37
  if submit:
38
  if guess.lower() == st.session_state.chosen_name.lower():
39
  st.success(f"CONGRATULATIONS!!! YOU GUESSED IT CORRECTLY! IT IS {st.session_state.chosen_name}")
40
+ st.stop()
41
 
42
  if st.session_state.attempts < st.session_state.max_attempts - 1:
43
  st.warning("That's Not Correct. Please Try Again.")
44
  else:
45
+ st.error(f"Sorry, You're Out Of Attempts. The Correct Answer Was {st.session_state.chosen_name}.")
46
+ st.stop()
47
 
48
+ if clear:
49
  del st.session_state.choosen_name
50
  del st.session_state.description
51
  del st.session_state.attempts