File size: 7,667 Bytes
e2df0ee
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69046f9
 
 
 
 
 
 
 
 
 
 
 
 
 
a506cf7
69046f9
 
 
 
 
 
 
 
 
 
 
 
 
a506cf7
69046f9
 
 
 
 
 
 
 
 
 
 
 
 
a506cf7
69046f9
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
import streamlit as st
import random
import pandas as pd
from datetime import datetime

# Define the game mechanics

def generate_scenario():
    scenarios = ['🦸 You are a superhero saving the world from a meteorite', 
                 'πŸ΄β€β˜ οΈ You are a pirate searching for treasure on a deserted island', 
                 'πŸ‘¨β€πŸ³ You are a chef trying to win a cooking competition', 
                 'πŸ•΅οΈ You are a detective solving a murder case']
    return random.choice(scenarios)

def calculate_score(slider_values):
    bluffing_score, deduction_score, humor_score, memory_score, roleplay_score = slider_values

    total_score = bluffing_score + deduction_score + humor_score + memory_score + roleplay_score
    return total_score

def play_game(slider_values):
    scenario = generate_scenario()
    st.write('🎭 Act out the following scenario: ' + scenario)
    total_score = calculate_score(slider_values)
    st.write('🎯 Your total score is: ' + str(total_score))

    # Save game history to a dataframe
    game_history_df = pd.DataFrame({'Scenario': [scenario],
                                    'Bluffing': [slider_values[0]],
                                    'Deduction': [slider_values[1]],
                                    'Humor': [slider_values[2]],
                                    'Memory': [slider_values[3]],
                                    'Roleplay': [slider_values[4]],
                                    'Total Score': [total_score]})

    # Append to existing game history
    try:
        existing_game_history = pd.read_csv('game_history.csv')
        game_history_df = pd.concat([existing_game_history, game_history_df], ignore_index=True)
    except:
        pass

    return game_history_df

def save_game_history(game_history_df):
    game_history_df.to_csv('game_history.csv', index=False)
    st.write('πŸ“ Game history saved!')
    st.write(game_history_df)

def save_simulation_results(simulation_results_df):
    filename = datetime.now().strftime('%Y-%m-%d %H-%M-%S') + '.csv'
    simulation_results_df.to_csv(filename, index=False)
    st.write('πŸ“ Simulation results saved!')
    st.write(simulation_results_df)

def run_simulations(num_simulations):
    total_scores = []
    simulation_results_df = pd.DataFrame(columns=['Scenario', 'Bluffing', 'Deduction', 'Humor', 'Memory', 'Roleplay', 'Total Score'])
    for i in range(num_simulations):
        slider_values = [random.randint(1, 10) for i in range(5)]
        total_score = calculate_score(slider_values)
        total_scores.append(total_score)
        scenario = generate_scenario()
        simulation_results_df = simulation_results_df.append({'Scenario': scenario,
                                                              'Bluffing': slider_values[0],
                                                              'Deduction': slider_values[1],
                                                              'Humor': slider_values[2],
                                                              'Memory': slider_values[3],
                                                              'Roleplay': slider_values[4],
                                                              'Total Score': total_score}, ignore_index=True)
    st.write('🎲 Average score from ' + str(num_simulations) + ' simulations: ' + str(sum(total_scores)/len(total_scores)))
    st.write(simulation_results_df)
    save_simulation_results(simulation_results_df)


# Define the Streamlit app

st.title('🎭 Acting Game Mechanics')
st.write('🎯 Welcome to the Acting Game Mechanics! This game measures your ability to bluff, deduce, use humor, remember details, and role-play. Drag the sliders to the left or right to adjust each skill, and click 🎭 Play to act out a scenario and receive a score.')

slider_values = [st.slider('πŸƒ Bluffing', 1, 10, 5),
st.slider('πŸ•΅οΈ Deduction', 1, 10, 5),
st.slider('πŸ˜‚ Humor', 1, 10, 5),
st.slider('🧠 Memory', 1, 10, 5),
st.slider('πŸ‘₯ Roleplay', 1, 10, 5)]

if st.button('🎭 Play'):
    game_history_df = play_game(slider_values)
    save_game_history(game_history_df)

if st.button('🎲 Run simulations'):
    num_simulations = st.slider('πŸ” Number of simulations', 1, 100000, 1000)
    run_simulations(num_simulations)

if st.button('πŸ“ Show all game history'):
    try:
        game_history_df = pd.read_csv('game_history.csv')
        st.write(game_history_df)
    except:
        st.write('No game history found')

if st.button('πŸ“ Download game history'):
    try:
        game_history_df = pd.read_csv('game_history.csv')
        filename = 'game_history_' + datetime.now().strftime('%Y-%m-%d %H-%M-%S') + '.csv'
        game_history_df.to_csv(filename, index=False)
        st.write('πŸ“ Game history downloaded!')
        st.write(game_history_df)
    except:
        st.write('No game history found')

if st.button('πŸ“ Download simulation results'):
    try:
        simulation_results_df = pd.read_csv('simulation_results.csv')
        filename = 'simulation_results_' + datetime.now().strftime('%Y-%m-%d %H-%M-%S') + '.csv'
        simulation_results_df.to_csv(filename, index=False)
        st.write('πŸ“ Simulation results downloaded!')
        st.write(simulation_results_df)
    except:
        st.write('No simulation results found')

st.markdown("""
🎭 Acting Game Mechanics 
πŸŽ―πŸƒ Bluffing
πŸ•΅οΈ Deduction
πŸ˜‚ Humor
🧠 Memory
πŸ‘₯ Roleplay

🎭 Acting Game Mechanics:

Characterization: Act out your character's traits, emotions, and personality.
Improvisation: Think on your feet and come up with responses to unexpected situations.
Scripted Dialogue: Deliver lines from a pre-written script or engage in scripted conversations.
For more information on Acting Game Mechanics, you can visit the Wikipedia page on Role-playing game mechanics: https://en.wikipedia.org/wiki/Acting

πŸŽ―πŸƒ Bluffing:

Lying: Convince others that your false information is true.
Concealment: Hide your true intentions or actions.
Misdirection: Lead others to believe something different from what you are doing.
For more information on Bluffing, you can visit the Wikipedia page on Bluff (poker): https://en.wikipedia.org/wiki/Bluff_(poker)

πŸ•΅οΈ Deduction:

Clue Analysis: Examine clues to draw conclusions about a mystery.
Logical Reasoning: Use deductive reasoning to arrive at the correct solution.
Pattern Recognition: Recognize and match patterns to uncover hidden information.
For more information on Deduction, you can visit the Wikipedia page on Deduction game: https://en.wikipedia.org/wiki/Deduction

πŸ˜‚ Humor:

Parody: Use humorous exaggeration or imitation to make fun of a subject.
Puns: Play with words to create humorous meanings.
Satire: Use irony, sarcasm, and ridicule to critique a topic or individual.
For more information on Humor, you can visit the Wikipedia page on Humor: https://en.wikipedia.org/wiki/Humor

🧠 Memory:

Recall: Remember information from previous events or interactions.
Recognition: Identify information you have seen or heard before.
Memorization: Commit information to memory for future use.
For more information on Memory, you can visit the Wikipedia page on Memory game: https://en.wikipedia.org/wiki/Memory

πŸ‘₯ Roleplay:

Character Creation: Develop a unique character with specific traits and abilities.
Storytelling: Create a narrative with the characters and the world they inhabit.
Collaborative Play: Work with others to create an immersive experience.
For more information on Roleplay, you can visit the Wikipedia page on Role-playing game: https://en.wikipedia.org/wiki/Role-playing_game

""")