3 ms·
https://github.com/qntm/tetris/blob/7c108f1f676233da9f20d83134b546ad41d5a0ab/tetris.c#L434-L443 https://github.com/qntm/tetris/blob/7c108f1f676233da9f20d831...
by perihelions 5y ago
https://github.com/qntm/tetris/blob/7c108f1f676233da9f20d83134b546ad41d5a0ab/tetris.c#L434-L443 https://github.com/qntm/tetris/blob/7c108f1f676233da9f20d831...
https://github.com/qntm/tetris/blob/7c108f1f676233da9f20d83134b546ad41d5a0ab/tetris.c#L653-L657 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.