Source: Javascript Tetris, how it works
Combine features into a heuristic score:
(-0.51 * aggHeight + 0.76 * completeLines - 0.36 * holes - 0.18 * bumpiness) $\to\max$
(-0.51 * aggHeight + 0.76 * completeLines - 0.36 * holes - 0.18 * bumpiness) $\to\max$
Case | Rows | Score |
---|---|---|
Heuristic with bugs | 0 | 222 |
Fixed Possible Moves | 5 | 1 036 |
Fixed Heigh calculation | 612 | 78 268 |
Ok, looks good, but what about Beam Search?
(-0.51 * aggHeight + 0.76 * completeLines - 0.36 * holes - 0.18 * bumpiness) $\to\max$
Case | Rows | Score |
---|---|---|
Heuristic with bugs | 0 | 222 |
Fixed Possible Moves | 5 | 1 036 |
Fixed Heigh calculation | 612 | 78 268 |
Full Search w\ Next Piece | 44 301 | 5 623 130 |
Time to rewrite it in Python!
Let's trust Junie to do the hard work:
Prompt 1: Look at the javascript tetris project and come up with the plan of rewriting it in Python. Write all the details in the `python-tetris/plan.md` file.
Prompt 2: Implement the tetris in Python according to the `python-tetris/plan.md`, but replace the texture.jpg background to the simple gray grid.
Prompt 3: The game in Python works, but there is no AI mode, only flag for it.