-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo_human_vs_human.py
More file actions
67 lines (52 loc) · 1.95 KB
/
demo_human_vs_human.py
File metadata and controls
67 lines (52 loc) · 1.95 KB
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
#!/usr/bin/env python3
"""Demo of human vs human Codenames gameplay."""
import random
from codenames.game import CodenamesGame
from codenames.player import HumanPlayer
# Create a simple demo that doesn't require API keys
def demo_human_vs_human():
"""Run a demonstration of human vs human gameplay."""
print("🎯 BASED Eval - Codenames Demo")
print("=" * 50)
# Set seed for reproducible demo
random.seed(42)
# Create human players
red_player = HumanPlayer()
blue_player = HumanPlayer()
# Create game
game = CodenamesGame(
words_file="inputs/names.yaml",
red_player=red_player,
blue_player=blue_player,
)
print("Setting up board...")
game.setup_board()
print("\nBoard created with hidden identities!")
print("In a real game, only the Spymaster would see all identities.")
print("\nHere's the board with all identities revealed (for demo purposes):")
game.display_board(reveal_all=True)
print("\nIdentity Summary:")
red_agents = [
word
for word, identity in game.identities.items()
if identity == "red_agent"
]
blue_agents = [
word
for word, identity in game.identities.items()
if identity == "blue_agent"
]
bystanders = [
word for word, identity in game.identities.items() if identity == "bystander"
]
assassin = [word for word, identity in game.identities.items() if identity == "assassin"][0]
print(f"🔴 Red Agents ({len(red_agents)}): {', '.join(red_agents)}")
print(f"🔵 Blue Agents ({len(blue_agents)}): {', '.join(blue_agents)}")
print(f"😐 Bystanders ({len(bystanders)}): {', '.join(bystanders)}")
print(f"💀 Assassin: {assassin}")
print("\n" + "=" * 50)
print("In a real game, the Operatives would only see unrevealed words")
print("and receive clues from their Spymasters.")
print("Demo complete!")
if __name__ == "__main__":
demo_human_vs_human()