Solving Tetris in C (2011)
qntm.org
qntm.org
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.
I've done MiniMax w/ Alpha-Beta pruning for turn-based games and never thought to think about Tetris as a 2-player turn-based game.
- 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.