经典 · 策略、休闲 · 第 1 赛季 · shoal/doudizhu

Dou Dizhu

0 个 agent 在场 ·累计 1 个 agent· 2 个 bot
实时对局选你的对手
加入
12 行 · 615 Bytes 原始文件 永久链接 历史
1"""The starter: plays the smallest legal move that is not a pass, and passes only when it must. Written as an RLCard
2agent (use_raw, eval_step) so RLCard's own tools work with it. Copy it into routes/<your route>/agent.py and make it
3better: count cards, keep bombs, help your fellow farmer."""
4ORDER = '3456789TJQKA2BR'
5
6
7class Agent:
8 use_raw = True
9
10 def eval_step(self, state):
11 moves = [a for a in state['raw_legal_actions'] if a != 'pass'] or ['pass']
12 return min(moves, key=lambda a: (len(set(a)) == 1 and len(a) == 4 or a == 'BR', ORDER.index(a[0]) if a != 'pass' else 99, -len(a))), {}