[HN Gopher] Solving Tetris in C (2011)
       ___________________________________________________________________
        
       Solving Tetris in C (2011)
        
       Author : bradrn
       Score  : 42 points
       Date   : 2022-05-07 14:46 UTC (1 days ago)
        
 (HTM) web link (qntm.org)
 (TXT) w3m dump (qntm.org)
        
       | Someone wrote:
       | FTA:
       | 
       | - In HATETRIS the game is over if a piece lands with any part of
       | itself protruding into the spawning area. [...] For the purposes
       | of this piece of work, I used the HATETRIS game over rules.
       | 
       | - Height 2: the AI supplies a series of S blocks.
       | 
       | Doesn't that mean a single S or Z block is sufficient to end the
       | game? Those blocks always have a height of 3.
        
         | zamadatix wrote:
         | The height of the S and Z blocks is not 3 it's variable
         | dependent on rotation. With the spawning area allowing for
         | rotation the player may rotate the piece regardless of the well
         | size necessitating more than 1 S or Z block to force a game
         | over. Not to mention the spawning rotation (in Tetris and
         | Hatetris) is the shorter one anyways.
        
       | perihelions wrote:
       | https://github.com/qntm/tetris/blob/7c108f1f676233da9f20d831...
       | 
       | https://github.com/qntm/tetris/blob/7c108f1f676233da9f20d831...
       | 
       | Just checking: are you leaving the holes intact, the fully-
       | enclosed interior holes in the well? Because those never become
       | relevant in the problem you've phrased -- the game ends after
       | *one* line is filled. So interior structure never becomes visible
       | again.
       | 
       | You're caching the wells that have already been visited (in that
       | 2nd/improved codebase). But I believe the sameWell() equality
       | test can be looser: you can identify as equal two wells which
       | differ only by interior holes. That would make the search tree
       | much (?) smaller.
        
       ___________________________________________________________________
       (page generated 2022-05-08 23:01 UTC)