Skip to content

Commit 0a8fb96

Browse files
committed
feat(strategy): add default strategy
1 parent 16bcc64 commit 0a8fb96

5 files changed

Lines changed: 1355 additions & 0 deletions

File tree

Lines changed: 294 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,294 @@
1+
# Current Game State
2+
3+
{% if G.state == "SELECTING_HAND" -%}
4+
- **Phase**: Playing Phase (gamestate is SELECTING_HAND)
5+
- **Round**: {{ G.round_num }}
6+
- **Ante**: {{ G.ante_num }}/8
7+
- **Money**: ${{ G.money }}
8+
- **Hands left**: {{ G.round.hands_left }}/{{ G.round.hands_left + G.round.hands_played }}
9+
- **Discards left**: {{ G.round.discards_left }}/{{ G.round.discards_left + G.round.discards_used }}
10+
- **Current Blind**: {% if G.blinds.small.status == "CURRENT" %}Small{% elif G.blinds.big.status == "CURRENT" %}Big{% elif G.blinds.boss.status == "CURRENT" %}Boss ({{ G.blinds.boss.name }}: {{ G.blinds.boss.effect }}){% endif %}
11+
- **Target Score**: {% if G.blinds.small.status == "CURRENT" %}{{ G.blinds.small.score }}{% elif G.blinds.big.status == "CURRENT" %}{{ G.blinds.big.score }}{% elif G.blinds.boss.status == "CURRENT" %}{{ G.blinds.boss.score }}{% endif %}
12+
- **Current Score**: {{ G.round.chips }}
13+
{%- elif G.state == "SHOP" %}
14+
- **Phase**: Shop Phase (gamestate is SHOP)
15+
- **Round**: {{ G.round_num }}
16+
- **Ante**: {{ G.ante_num }}/8
17+
- **Money**: ${{ G.money }}
18+
{%- elif G.state == "BLIND_SELECT" %}
19+
- **Phase**: Blind Selection (gamestate is BLIND_SELECT)
20+
- **Round**: {{ G.round_num }}
21+
- **Ante**: {{ G.ante_num }}/8
22+
- **Money**: ${{ G.money }}
23+
{%- endif %}
24+
- **Deck**: {{ G.deck }}
25+
- **Stake**: {{ G.stake }}
26+
{% if G.seed %}- **Seed**: {{ G.seed }}{% endif %}
27+
28+
## Jokers
29+
30+
The current Jokers count is {{ G.jokers.count }}/{{ G.jokers.limit }}.
31+
{% for j in G.jokers.cards -%}
32+
{% if not j.state.hidden %}
33+
- {{ loop.index0 }}: {{ j.label }} ({{ j.value.effect }})
34+
- **Sell value**: ${{ j.cost.sell }}
35+
{%- if j.modifier.edition %}
36+
- **{{ j.modifier.edition }} Edition**
37+
{%- endif %}
38+
{%- if j.modifier.eternal %}
39+
- **Eternal**: cannot be sold or destroyed
40+
{%- endif %}
41+
{%- if j.modifier.perishable %}
42+
- **Perishable**: {{ j.modifier.perishable }} rounds remaining
43+
{%- endif %}
44+
{%- if j.modifier.rental %}
45+
- **Rental**: costs $1 per round
46+
{%- endif %}
47+
{%- if j.state.debuff %}
48+
- **Debuff**: this joker is debuffed so its effect is disabled
49+
{%- endif %}
50+
{%- else %}
51+
- {{ loop.index0 }}: the joker is face down
52+
{%- endif %}
53+
{%- endfor %}
54+
55+
## Consumables
56+
57+
The current Consumables count is {{ G.consumables.count }}/{{ G.consumables.limit }}.
58+
{% for c in G.consumables.cards -%}
59+
{% if not c.state.hidden %}
60+
- {{ loop.index0 }}: {{ c.label }} ({{ c.value.effect }})
61+
- **Sell value**: ${{ c.cost.sell }}
62+
{%- if c.modifier.edition %}
63+
- **{{ c.modifier.edition }} Edition**
64+
{%- endif %}
65+
{%- if c.state.debuff %}
66+
- **Debuff**: this consumable is debuffed so its effect is disabled
67+
{%- endif %}
68+
{%- else %}
69+
- {{ loop.index0 }}: the consumable is face down
70+
{%- endif %}
71+
{%- endfor %}
72+
73+
{% if G.used_vouchers|length > 0 -%}
74+
## Vouchers
75+
76+
Here is the list of vouchers redeemed during the run:
77+
78+
{% for name, effect in G.used_vouchers.items() -%}
79+
- {{ name }}: {{ effect }}
80+
{% endfor -%}
81+
{% endif -%}
82+
83+
## Poker Hands
84+
85+
Here is a list of the poker hands and their levels:
86+
87+
{% for name, hand in G.hands.items() -%}
88+
- **{{ name }}** (Level {{ hand.level }}):
89+
- **Chips**: {{ hand.chips }}
90+
- **Mult**: {{ hand.mult }}
91+
- **Example**: `{% for c in hand.example %}{{ c[0] }}{% if not c[1] %} (not scored){% endif %}{% if not loop.last %}, {% endif %}{% endfor %}`
92+
- During this run you have played {{ name }} {{ hand.played }} times, {{ hand.played_this_round }} of which were played this round.
93+
{% endfor %}
94+
95+
{% if G.state == "SELECTING_HAND" -%}
96+
## Current Hand
97+
98+
The current card count is {{ G.hand.count }} / {{ G.hand.limit }}
99+
**CRITICAL LIMIT: You can play or discard MAXIMUM {{ G.hand.highlighted_limit }} cards per action - NEVER MORE THAN {{ G.hand.highlighted_limit }} CARDS (this is an absolute game rule).**
100+
101+
{% for c in G.hand.cards %}
102+
{%- if not c.state.hidden %}
103+
{%- if c.modifier.enhancement == "STONE" %}
104+
- {{ loop.index0 }}: this is a stone card (no suit and no rank)
105+
{%- else %}
106+
- {{ loop.index0 }}: {{ c.value.rank }} of {{ c.value.suit }} (`{{ c.key }}`)
107+
{%- if c.modifier.edition %}
108+
- **{{ c.modifier.edition }} Edition**
109+
{%- endif %}
110+
{%- if c.modifier.enhancement %}
111+
- **{{ c.modifier.enhancement }} Enhancement**
112+
{%- endif %}
113+
{%- if c.modifier.seal %}
114+
- **{{ c.modifier.seal }} Seal**
115+
{%- endif %}
116+
{%- if c.state.debuff %}
117+
- **Debuff**: this card is debuffed and will not be counted in scoring
118+
{%- endif %}
119+
{%- endif %}
120+
{%- else %}
121+
- {{ loop.index0 }}: the card is face down
122+
{%- endif %}
123+
{%- endfor %}
124+
{%- endif %}
125+
126+
{% if G.state == "SHOP" -%}
127+
## Shop
128+
129+
Here are the available cards in the shop:
130+
131+
{% for card in G.shop.cards -%}
132+
{% if not card.state.hidden %}
133+
{%- if card.set == "JOKER" %}
134+
- {{ loop.index0 }}: {{ card.label }} ({{ card.value.effect }})
135+
- **Set**: Joker
136+
- **Cost**: ${{ card.cost.buy }}
137+
- **Sell value**: ${{ card.cost.sell }}
138+
{%- if card.modifier.edition %}
139+
- **{{ card.modifier.edition }} Edition**
140+
{%- endif %}
141+
{%- if card.state.debuff %}
142+
- **Debuff**: this card is debuffed
143+
{%- endif %}
144+
{%- elif card.set in ["TAROT", "PLANET", "SPECTRAL"] %}
145+
- {{ loop.index0 }}: {{ card.label }} ({{ card.value.effect }})
146+
- **Set**: {{ card.set|title }}
147+
- **Cost**: ${{ card.cost.buy }}
148+
- **Sell value**: ${{ card.cost.sell }}
149+
{%- if card.state.debuff %}
150+
- **Debuff**: this card is debuffed
151+
{%- endif %}
152+
{%- elif card.set in ["DEFAULT", "ENHANCED"] %}
153+
{%- if card.modifier.enhancement == "STONE" %}
154+
- {{ loop.index0 }}: this is a stone card (no suit and no rank)
155+
- **Set**: Playing Card
156+
- **Cost**: ${{ card.cost.buy }}
157+
- **Sell value**: ${{ card.cost.sell }}
158+
{%- else %}
159+
- {{ loop.index0 }}: {{ card.value.rank }} of {{ card.value.suit }} (`{{ card.key }}`)
160+
- **Set**: Playing Card
161+
- **Cost**: ${{ card.cost.buy }}
162+
- **Sell value**: ${{ card.cost.sell }}
163+
{%- if card.modifier.edition %}
164+
- **{{ card.modifier.edition }} Edition**
165+
{%- endif %}
166+
{%- if card.modifier.enhancement %}
167+
- **{{ card.modifier.enhancement }} Enhancement**
168+
{%- endif %}
169+
{%- if card.modifier.seal %}
170+
- **{{ card.modifier.seal }} Seal**
171+
{%- endif %}
172+
{%- if card.state.debuff %}
173+
- **Debuff**: this card is debuffed
174+
{%- endif %}
175+
{%- endif %}
176+
{%- endif %}
177+
{%- else %}
178+
- {{ loop.index0 }}: the card is face down
179+
{%- endif %}
180+
{%- endfor %}
181+
182+
The cost of the reroll is ${{ G.round.reroll_cost }}.
183+
184+
{% if G.vouchers.cards %}
185+
Here are the vouchers that can be redeemed:
186+
{% for voucher in G.vouchers.cards -%}
187+
{%- if not voucher.state.hidden %}
188+
- {{ loop.index0 }}: {{ voucher.label }} ({{ voucher.value.effect }})
189+
- **Cost**: ${{ voucher.cost.buy }}
190+
{%- else %}
191+
- {{ loop.index0 }}: the voucher is face down
192+
{%- endif %}
193+
{%- endfor %}
194+
{% endif %}
195+
196+
{#- Packs purchase not yet supported
197+
{% if G.packs.cards %}
198+
Here are the booster packs that can be opened:
199+
{% for pack in G.packs.cards -%}
200+
- {{ loop.index0 }}: {{ pack.label }}
201+
- **Cost**: ${{ pack.cost.buy }}
202+
{% endfor %}
203+
{% endif %}
204+
-#}
205+
{%- endif %}
206+
207+
{% if G.state == "BLIND_SELECT" -%}
208+
## Blind Selection
209+
210+
### Small Blind
211+
- **Status**: {{ G.blinds.small.status }}
212+
- **Score**: {{ G.blinds.small.score }}
213+
{% if G.blinds.small.tag_name %}- **Tag**: {{ G.blinds.small.tag_name }}{% if G.blinds.small.tag_effect %} - {{ G.blinds.small.tag_effect }}{% endif %}{% endif %}
214+
215+
### Big Blind
216+
- **Status**: {{ G.blinds.big.status }}
217+
- **Score**: {{ G.blinds.big.score }}
218+
{% if G.blinds.big.tag_name %}- **Tag**: {{ G.blinds.big.tag_name }}{% if G.blinds.big.tag_effect %} - {{ G.blinds.big.tag_effect }}{% endif %}{% endif %}
219+
220+
### Boss Blind
221+
- **Name**: {{ G.blinds.boss.name }}
222+
- **Status**: {{ G.blinds.boss.status }}
223+
- **Score**: {{ G.blinds.boss.score }}
224+
{% if G.blinds.boss.effect %}- **Effect**: {{ G.blinds.boss.effect }}{% endif %}
225+
{%- endif %}
226+
227+
# Tools available
228+
229+
You **MUST** use one of the following tools to perform the intended action:
230+
231+
{% if G.state == "SELECTING_HAND" -%}
232+
- Play cards from hand
233+
- Function: `play`
234+
- Parameters:
235+
- `cards`: (list) 0-based indices of cards to play (1-5 cards)
236+
- `reasoning`: (string) Strategic reasoning for playing these cards
237+
- Discard cards from hand
238+
- Function: `discard`
239+
- Parameters:
240+
- `cards`: (list) 0-based indices of cards to discard
241+
- `reasoning`: (string) Strategic reasoning for discarding these cards
242+
- Rearrange cards in hand, jokers, or consumables
243+
- Function: `rearrange`
244+
- Parameters (provide exactly one of):
245+
- `hand`: (list) New order of hand cards (0-based indices, must include all cards)
246+
- `jokers`: (list) New order of jokers (0-based indices, must include all jokers)
247+
- `consumables`: (list) New order of consumables (0-based indices, must include all consumables)
248+
- `reasoning`: (string) Strategic reasoning for this arrangement
249+
{% elif G.state == "SHOP" -%}
250+
- Buy a card, voucher, or pack from the shop
251+
- Function: `buy`
252+
- Parameters (provide exactly one of):
253+
- `card`: (integer) 0-based index of shop card to buy
254+
- `voucher`: (integer) 0-based index of voucher to buy
255+
- `pack`: (integer) 0-based index of booster pack to buy
256+
- `reasoning`: (string) Strategic reasoning for this purchase
257+
- Reroll the shop items
258+
- Function: `reroll`
259+
- Parameters:
260+
- `reasoning`: (string) Strategic reasoning for rerolling
261+
- Leave the shop and advance to blind selection
262+
- Function: `next_round`
263+
- Parameters:
264+
- `reasoning`: (string) Strategic reasoning for leaving the shop
265+
- Rearrange jokers or consumables
266+
- Function: `rearrange`
267+
- Parameters (provide exactly one of):
268+
- `jokers`: (list) New order of jokers (0-based indices, must include all jokers)
269+
- `consumables`: (list) New order of consumables (0-based indices, must include all consumables)
270+
- `reasoning`: (string) Strategic reasoning for this arrangement
271+
{% elif G.state == "BLIND_SELECT" -%}
272+
- Select the current blind to play
273+
- Function: `select`
274+
- Parameters:
275+
- `reasoning`: (string) Strategic reasoning for selecting this blind
276+
- Skip the current blind (small or big blind only) to receive the tag reward
277+
- Function: `skip`
278+
- Parameters:
279+
- `reasoning`: (string) Strategic reasoning for skipping this blind
280+
{% endif -%}
281+
{% if G.state in ["SELECTING_HAND", "SHOP"] -%}
282+
- Sell a joker or consumable for money
283+
- Function: `sell`
284+
- Parameters (provide exactly one of):
285+
- `joker`: (integer) 0-based index of joker to sell
286+
- `consumable`: (integer) 0-based index of consumable to sell
287+
- `reasoning`: (string) Strategic reasoning for selling
288+
- Use a consumable card (Tarot, Planet, or Spectral)
289+
- Function: `use`
290+
- Parameters:
291+
- `consumable`: (integer) 0-based index of consumable to use
292+
- `cards`: (list) 0-based indices of cards to target (required for some consumables)
293+
- `reasoning`: (string) Strategic reasoning for using this consumable
294+
{% endif -%}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Memory & Previous Actions
2+
3+
{% if history %}
4+
## Recent Decision History
5+
6+
Here is a list of your recent decisions (from oldest to newest):
7+
{% set max_history = 10 if history|length > 10 else history|length %}
8+
{% for entry in history[-max_history:] %}
9+
**{{ loop.index }}.** `{{ entry.method }}({{ entry.params }})` - {{ entry.reasoning }}
10+
{% endfor %}
11+
{% endif %}
12+
13+
## Strategic Context
14+
{% if history %}
15+
Based on your recent actions, consider:
16+
- How your decisions are building towards a cohesive strategy
17+
- Whether your current approach is working or needs adjustment
18+
- Patterns in your play that might need to change
19+
{% else %}
20+
This is the beginning of the game. Focus on:
21+
- Establishing a clear strategic direction
22+
- Making decisions that set up long-term synergies
23+
- Building towards a specific poker hand type
24+
{% endif %}
25+
26+
{% if last_error_call_msg %}
27+
**NOTE**: **Your last response was invalid**: {{ last_error_call_msg }}
28+
Please ensure your next response includes a proper tool call with valid function name and JSON arguments.
29+
{% endif %}
30+
31+
{% if last_failed_call_msg %}
32+
**NOTE**: **Your last tool call failed**: {{ last_failed_call_msg }}
33+
The tool call was formatted correctly but execution failed. Please try a different approach.
34+
{% endif %}

0 commit comments

Comments
 (0)