[HN Gopher] Yahtzeeql - Yahtzee solver that's mostly SQL
       ___________________________________________________________________
        
       Yahtzeeql - Yahtzee solver that's mostly SQL
        
       Author : skadamat
       Score  : 10 points
       Date   : 2025-05-15 13:51 UTC (3 days ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | BarryGuff wrote:
       | Yahtzee is 100% random luck from dice rolls. You can't "solve"
       | it.
        
         | sram1337 wrote:
         | What do you think the link is about then?
        
         | AStonesThrow wrote:
         | _So I handed him my bottle,
         | 
         | And he drank down my last swallow
         | 
         | Then he bummed a cigarette,
         | 
         | And asked me for a light
         | 
         | And the night got deathly quiet
         | 
         | And his face lost all expression...
         | 
         | "If you're gonna play the game, boy,
         | 
         | Gotta learn to play it right."_
        
         | xyst wrote:
         | skill issue
        
         | nkrisc wrote:
         | The rolls may be random, and luck is a significant factor, but
         | the game as a whole is not 100% random luck. You still have to
         | make decisions.
         | 
         | I do agree that "solve" isn't the right word. Probably more
         | accurate to refer to an optimal strategy.
        
       | canvascritic wrote:
       | This is a clever hack and a cute abuse of SQL joins to brute-
       | force what's essentially a 2-ply MDP over a finite space.
       | 
       | The core idea btw of using precomputed transition/score tables to
       | simulate and optimize turn-by-turn play is a classical
       | reinforcement learning method
       | 
       | What would be interesting here is to flip it: train a policy
       | network (maybe tiny, 2-layer MLP) to approximate the SQL policy.
       | then you could distill the SQL brute-force policy into something
       | fast and differentiable.
       | 
       | i'd love to see a variant where the optimizer isn't just
       | maximizing EV, but is tuned to human psychology. e.g., people
       | like getting Yahtzees more than getting 23 in chance. could add a
       | utility function over scores.
       | 
       | Anyway this is a great repo for students to learn expected value
       | optimization with simple mechanics.
        
       ___________________________________________________________________
       (page generated 2025-05-18 23:00 UTC)