Regeln fuer River, Flop/Turn, Einsaetze und Iso gegen Limper (nl2.rs), Tafeln ohne Spielerkennungen. Gemeinsam gegen den Trainer-Pool: +8,0 +-3,9 bb/100 mit bekanntem Typ, +0,9 +-6,6 ohne. Gewinn live nicht belegt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
46 lines
2.6 KiB
Python
46 lines
2.6 KiB
Python
# Alle Haende mit >=30 bb Umsatz (Verlust) vom 22.11.: Gegnerkarten aus winnerInfo, Siegchance als unser groesster Betrag hineinging
|
|
import gzip,json,re,glob,collections,random,sys,itertools
|
|
sys.path.insert(0,"entscheiden"); import eval7 as E
|
|
L=".claude/worktrees/engine-lecks-angreifen-de7b88/archiv/lauf/"
|
|
tag,schw=sys.argv[1],float(sys.argv[2])
|
|
H={r["hand"]:r for r in map(json.loads,open(L+"haende.jsonl",encoding="utf-8")) if r["zeit"][:10]>=tag and r["bb"]==.02 and r["spielart"]=="NLHE"}
|
|
Z=collections.defaultdict(list)
|
|
for z in open(L+"zuege.jsonl",encoding="utf-8"):
|
|
r=json.loads(z)
|
|
if r["hand"] in H: Z[r["hand"]].append(r)
|
|
W={}
|
|
RK=dict(zip("TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE TEN JACK QUEEN KING ACE".split(),"23456789TJQKA"))
|
|
for f in glob.glob("archiv/rohlog/*.gz"):
|
|
for z in gzip.open(f,"rt",encoding="utf-8",errors="replace"):
|
|
if '"game.winnerInfo"' not in z: continue
|
|
t=z.replace('\\"','"'); m=re.search(r'"gameHandId":"(\d+)"',t)
|
|
if not m or m.group(1) not in H: continue
|
|
for p in re.finditer(r'"playerName":"([^"]+)","userBestHand":\{"userCards":\[(.*?)\]',t):
|
|
c=[RK[b]+a[0].lower() for a,b in re.findall(r'"suit":"(\w+)","value":"(\w+)"',p.group(2))]
|
|
if p.group(1)!="mmintel" and len(c)==2: W.setdefault(m.group(1),{})[p.group(1)]=c
|
|
def eq(h,g,b):
|
|
h,g,b=E.karten(h),E.karten(g),E.karten(b); rest=[c for c in E.VOLLDECK if c not in h+g+b]; k=5-len(b)
|
|
its=list(itertools.combinations(rest,k)) if k<=2 else [random.sample(rest,k) for _ in range(3000)]
|
|
x=0
|
|
for q in its:
|
|
a,c=E.score7(h+b+list(q)),E.score7(g+b+list(q)); x+=1 if a>c else .5 if a==c else 0
|
|
return x/len(its)
|
|
S=collections.Counter(); N=collections.Counter()
|
|
for h,r in sorted(H.items(),key=lambda x:x[1]["netto"]):
|
|
n=r["netto"]/.02
|
|
if n>-schw: break
|
|
zs=Z.get(h,[])
|
|
best=None
|
|
for x in zs:
|
|
tc=x["toCall"]/.02; a=(x["aktion"]or"").upper(); g=tc if a=="CALL" else (x.get("groesse")or 0)/.02 if a not in("FOLD","CHECK") else 0
|
|
if best is None or g>=best[0]: best=(g,x,a)
|
|
w=W.get(h)
|
|
txt="Gegner nicht gezeigt (wir foldeten)" if not w else ""
|
|
if w:
|
|
o=list(w.values())[0]; e=eq(best[1]["hole"],o,best[1]["board"]); txt="".join(o)+" Chance %.0f%%"%(e*100)
|
|
kat="vorn >=50%" if e>=.5 else "hinten 25-50%" if e>=.25 else "weit hinten <25%"
|
|
else: kat="gefoldet nach Einzahlung"
|
|
S[kat]+=1; N[kat]+=n
|
|
print("%s %s %6.1f %s | %s %s %s %.0f bb (Topf %.0f) | %s"%(r["zeit"][5:16],h,n,"".join(best[1]["hole"]),best[1]["street"][0],"".join(best[1]["board"]),best[2],best[0],best[1]["pot"]/.02,txt))
|
|
for k in S: print(k,S[k],round(N[k]))
|