lucadipalma commited on
Commit
fbdf365
Β·
1 Parent(s): 301e15a

change example

Browse files
Files changed (2) hide show
  1. pages/how_to_play.py +2 -19
  2. support/game_settings.py +19 -5
pages/how_to_play.py CHANGED
@@ -1,30 +1,13 @@
1
  import gradio as gr
2
 
3
- from support.game_settings import EXAMPLE_GAME_RULES_HTML
4
 
5
 
6
- # Game board description HTML
7
- GAME_BOARD_HTML = """
8
- <div style="display: flex; flex-direction: column; gap: 20px;">
9
- <div><h3>🎯 Example Game Board</h3></div>
10
- <div>
11
- <p>Below is a sample Codenames board showing the <strong>Boss's view</strong> with color-coded words:</p>
12
- <ul>
13
- <li><strong style="color: #dc3545;">Red squares</strong> = Red team's words</li>
14
- <li><strong style="color: #0d6efd;">Blue squares</strong> = Blue team's words</li>
15
- <li><strong style="color: #6c757d;">Beige squares</strong> = Neutral words (innocent bystanders)</li>
16
- <li><strong style="color: #212529;">Black square</strong> = Killer word (instant loss if touched!)</li>
17
- </ul>
18
- <p><strong>Remember:</strong> Only the <strong>Boss</strong> sees these colors. The <strong>Captain</strong> and <strong>Players</strong> only see the words!</p>
19
- </div>
20
- </div>
21
- """
22
-
23
  with gr.Blocks(fill_width=True) as demo:
24
  # Rules section with HTML
25
  with gr.Row(elem_id="row_description", equal_height=True):
26
  with gr.Column():
27
- gr.HTML(GAME_BOARD_HTML, elem_id="game_board_description")
28
  gr.Image(
29
  "assets/example.png",
30
  label="Game Board (Boss's View)",
 
1
  import gradio as gr
2
 
3
+ from support.game_settings import EXAMPLE_GAME_RULES_HTML, EXAMPLE_GAME_BOARD_HTML
4
 
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  with gr.Blocks(fill_width=True) as demo:
7
  # Rules section with HTML
8
  with gr.Row(elem_id="row_description", equal_height=True):
9
  with gr.Column():
10
+ gr.HTML(EXAMPLE_GAME_BOARD_HTML, elem_id="game_board_description")
11
  gr.Image(
12
  "assets/example.png",
13
  label="Game Board (Boss's View)",
support/game_settings.py CHANGED
@@ -64,13 +64,12 @@ EXAMPLE_GAME_RULES_HTML = """
64
  <h4>1️⃣ Boss Gives a Clue</h4>
65
  <p>The Red Boss (seeing the board) might say:</p>
66
  <blockquote style="background: #f8f9fa; padding: 10px; border-left: 4px solid #dc3545;">
67
- <strong>"Atmosphere: 3"</strong>
68
  </blockquote>
69
- <p>This clue suggests 3 red words are related to "atmosphere". Looking at the board, the Boss is thinking of:</p>
70
  <ul>
71
  <li><strong>AIR</strong> (part of the atmosphere)</li>
72
  <li><strong>SPACE</strong> (beyond the atmosphere)</li>
73
- <li><strong>SOUND</strong> (travels through air, part of the atmosphere)</li>
74
  </ul>
75
  <p><em>⚠️ Important: The clue must be ONE word and ONE number. The number indicates how many words relate to that clue.</em></p>
76
 
@@ -79,7 +78,6 @@ EXAMPLE_GAME_RULES_HTML = """
79
  <ul>
80
  <li><strong>Player 1:</strong> "AIR feels like the safest bet β€” it's literally the atmosphere."</li>
81
  <li><strong>Player 2:</strong> "SPACE could connect because it's outside the atmosphere."</li>
82
- <li><strong>Captain:</strong> "SOUND could also fit β€” it travels through air. Let's prioritize those three."</li>
83
  </ul>
84
 
85
  <h4>3️⃣ Captain Makes Final Selection</h4>
@@ -87,7 +85,6 @@ EXAMPLE_GAME_RULES_HTML = """
87
  <ol>
88
  <li>AIR βœ… (Red - Correct!)</li>
89
  <li>SPACE βœ… (Red - Correct!)</li>
90
- <li>SOUND βœ… (Red - Correct!)</li>
91
  </ol>
92
  <p>The team can stop after any correct guess or continue up to the number given (+1 bonus from previous turns if applicable).</p>
93
 
@@ -123,6 +120,23 @@ EXAMPLE_GAME_RULES_HTML = """
123
  </div>
124
  """
125
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  GAME_RULES_HTML = """
127
  <div class="rules-content">
128
  <div class="rules-carousel-container">
 
64
  <h4>1️⃣ Boss Gives a Clue</h4>
65
  <p>The Red Boss (seeing the board) might say:</p>
66
  <blockquote style="background: #f8f9fa; padding: 10px; border-left: 4px solid #dc3545;">
67
+ <strong>"Atmosphere: 2"</strong>
68
  </blockquote>
69
+ <p>This clue suggests 2 red words are related to "atmosphere". Looking at the board, the Boss is thinking of:</p>
70
  <ul>
71
  <li><strong>AIR</strong> (part of the atmosphere)</li>
72
  <li><strong>SPACE</strong> (beyond the atmosphere)</li>
 
73
  </ul>
74
  <p><em>⚠️ Important: The clue must be ONE word and ONE number. The number indicates how many words relate to that clue.</em></p>
75
 
 
78
  <ul>
79
  <li><strong>Player 1:</strong> "AIR feels like the safest bet β€” it's literally the atmosphere."</li>
80
  <li><strong>Player 2:</strong> "SPACE could connect because it's outside the atmosphere."</li>
 
81
  </ul>
82
 
83
  <h4>3️⃣ Captain Makes Final Selection</h4>
 
85
  <ol>
86
  <li>AIR βœ… (Red - Correct!)</li>
87
  <li>SPACE βœ… (Red - Correct!)</li>
 
88
  </ol>
89
  <p>The team can stop after any correct guess or continue up to the number given (+1 bonus from previous turns if applicable).</p>
90
 
 
120
  </div>
121
  """
122
 
123
+ # Game board description HTML
124
+ EXAMPLE_GAME_BOARD_HTML = """
125
+ <div style="display: flex; flex-direction: column; gap: 20px;">
126
+ <div><h3>🎯 Example Game Board</h3></div>
127
+ <div>
128
+ <p>Below is a sample Codenames board showing the <strong>Boss's view</strong> with color-coded words:</p>
129
+ <ul>
130
+ <li><strong style="color: #dc3545;">Red squares</strong> = Red team's words</li>
131
+ <li><strong style="color: #0d6efd;">Blue squares</strong> = Blue team's words</li>
132
+ <li><strong style="color: #6c757d;">Beige squares</strong> = Neutral words (innocent bystanders)</li>
133
+ <li><strong style="color: #212529;">Black square</strong> = Killer word (instant loss if touched!)</li>
134
+ </ul>
135
+ <p><strong>Remember:</strong> Only the <strong>Boss</strong> sees these colors. The <strong>Captain</strong> and <strong>Players</strong> only see the words!</p>
136
+ </div>
137
+ </div>
138
+ """
139
+
140
  GAME_RULES_HTML = """
141
  <div class="rules-content">
142
  <div class="rules-carousel-container">