Tellmark is a trading game with hidden cards. One of the three table bots knows more than you, and at some point the news changes the game. Write a bot that plays it.
house bot, mean score over 50 hidden deals
The game is the same as the human game, with three changes:
Score: the same 0-100 card as for people. Edge (chips vs. holding your dealt cards), Calibration (your target guess and its confidence), Adaptation (trades in the 60 s after the shock), Discipline (trades against the bots that know or pretend to know).
The top 3 bots of the season get an intro to two hiring teams through plsintro. One key per email.
WebSocket: wss://tellmark.plsintro.com/bot?key=KEY&mode=practice&games=N or mode=final. One open connection per key.
| Server sends | Meaning |
|---|---|
hello | mode, number of games, seats (0 = you, 1-3 = Ada, Kai, Rio), suits |
game | a new game starts |
state | step, phase, round, timeLeft, hand, chips, cards, net, books, trades, shock, perCard, reveal, error. Answer every state with exactly one act. |
result | score of the game (practice: full card + bot kinds + settings) |
final | your final score |
You send {"t":"act","step":S,"a":ACTION}, where ACTION is one of:
null pass
{"t":"quote","suit":"circle","side":"bid","price":7} bid or offer (side "ask")
{"t":"cancel","suit":"circle","side":"bid"}
{"t":"take","suit":"circle","dir":"buy","limit":9} lift the offer / hit the bid ("sell")
{"t":"guess","suit":"bar","confidence":0.8} phase "guess", confidence 0.25-1
{"t":"answer","seat":2,"why":"..."} phase "question", seat 0-3
Phases: trading (240 steps per round), guess, reveal (send null), then round 2, then question. A trade clears every quote in the game.
Download tellmark_bot.py. It plays legal but weak moves and scores about 66. A bot that does nothing scores about 50.
# Tellmark bot track: minimal example client.
# pip install websockets (version 12 or newer)
# python tellmark_bot.py tm_yourkey -> 1 practice game
# python tellmark_bot.py tm_yourkey final -> your final (50 hidden deals, 1 per 24 h)
import json, random, sys
from websockets.sync.client import connect
KEY = sys.argv[1]
MODE = sys.argv[2] if len(sys.argv) > 2 else "practice"
URL = f"wss://tellmark.plsintro.com/bot?key={KEY}&mode={MODE}&games=1"
TWIN = {"circle": "square", "square": "circle", "triangle": "bar", "bar": "triangle"}
def decide(s):
"""Return one action for this step, or None to pass."""
hand = s["hand"]
# The suit you hold most is often the 12-card suit, so its twin is a fair first guess for the target.
target = TWIN[max(hand, key=hand.get)]
if s["phase"] == "guess":
return {"t": "guess", "suit": target, "confidence": 0.4}
if s["phase"] == "question":
return {"t": "answer", "seat": random.choice([0, 1, 2, 3]), "why": "example bot"}
if s["phase"] != "trading":
return None
ask = s["books"][target]["ask"]
if ask and ask["player"] != 0 and ask["price"] <= 6:
return {"t": "take", "suit": target, "dir": "buy", "limit": ask["price"]}
for suit, n in hand.items():
bid = s["books"][suit]["bid"]
if suit != target and n > 0 and bid and bid["player"] != 0 and bid["price"] >= 3:
return {"t": "take", "suit": suit, "dir": "sell", "limit": bid["price"]}
return None
with connect(URL) as ws:
for raw in ws:
m = json.loads(raw)
if m["t"] == "state":
if m.get("error"):
print("rejected:", m["error"])
ws.send(json.dumps({"t": "act", "step": m["step"], "a": decide(m)}))
elif m["t"] == "result":
print("game", m["game"], "score", m["total"])
elif m["t"] in ("final", "msg", "hello"):
print(m)