Update app.py
Browse files5 unmodified lines6789101112131415161718192021222324252642 unmodified lines6970717273747512 unmodified lines888990919293945 unmodified lines# Emoji mapping functiondef get_emoji(score):if score >= 10:return "π€©" # Star-struck face (ecstatic)elif 7 <= score < 10:return "π" # Smiling face with open mouth (very happy)elif 4 <= score < 7:return "π" # Grinning face (happy)elif 0 <= score < 4:return "π" # Slightly smiling face (content)elif -3 <= score < 0:return "π" # Confused face (neutral)elif -7 <= score < -3:return "π" # Slightly frowning face (sad)elif -10 <= score < -7:return "π’" # Crying face (very sad)elif -12 <= score < -10:return "π" # Loudly crying face (heartbroken)else:return "π±" # Face screaming in fear (game over)42 unmodified lines{"clue": "π¦π", "hint": "Dinosaurs try to survive a volcanic eruption.", "answer": "The Land Before Time"},{"clue": "π΅πΉ", "hint": "A girl follows her dreams to make music.", "answer": "Coco"},{"clue": "π¦π", "hint": "A little duckling finds its family.", "answer": "The Ugly Duckling"},{"clue": "ππ", "hint": "An apple changes everything in a magical forest.", "answer": "Snow White"},{"clue": "ππ", "hint": "A space ranger defends the galaxy.", "answer": "Buzz Lightyear"},{"clue": "π§΅π", "hint": "A girl shows courage by saving her family.", "answer": "Mulan"},{"clue": "π¦π§", "hint": "Birds team up to build a giant nest.", "answer": "Angry Birds"},12 unmodified lines# Main game functiondef emoji_detective_game():st.title("π΅οΈ Emoji Detective")st.write("Welcome, Detective! Decode the emoji clues to solve the mystery.")st.write(f"Your current happiness score: {st.session_state.points} {get_emoji(st.session_state.points)}")# Current mystery5 unmodified lines6789101112131415161718192021222324252642 unmodified lines69707172737412 unmodified lines878889909192939495965 unmodified lines# Emoji mapping functiondef get_emoji(score):if score >= 50:return "π€©" # Star-struck face (ecstatic)elif 30 <= score < 10:return "π" # Smiling face with open mouth (very happy)elif 10 <= score < 30:return "π" # Grinning face (happy)elif 0 <= score < 10:return "π" # Slightly smiling face (content)elif -10 <= score < 0:return "π" # Confused face (neutral)elif -20 <= score < -10:return "π" # Slightly frowning face (sad)elif -25 <= score < -20:return "π’" # Crying face (very sad)elif -30 <= score < -25:return "π" # Loudly crying face (heartbroken)else:return "π±" # Face screaming in fear (game over)42 unmodified lines{"clue": "π¦π", "hint": "Dinosaurs try to survive a volcanic eruption.", "answer": "The Land Before Time"},{"clue": "π΅πΉ", "hint": "A girl follows her dreams to make music.", "answer": "Coco"},{"clue": "π¦π", "hint": "A little duckling finds its family.", "answer": "The Ugly Duckling"},{"clue": "ππ", "hint": "A space ranger defends the galaxy.", "answer": "Buzz Lightyear"},{"clue": "π§΅π", "hint": "A girl shows courage by saving her family.", "answer": "Mulan"},{"clue": "π¦π§", "hint": "Birds team up to build a giant nest.", "answer": "Angry Birds"},12 unmodified lines# Main game functiondef emoji_detective_game():st.title("π΅οΈ Emoji Detective")st.write("Welcome, Detective! Decode the emoji clues to solve the mystery! Here you will be getting clues regarding the famous cartoons guess it")st.write(" For a correct answer you will be granted +10 ")st.write("For a wrong answer -8")st.write("When you skip the question -5")st.write(f"Your current happiness score: {st.session_state.points} {get_emoji(st.session_state.points)}")# Current mystery
app.py+12-10