Hatetris: Tetris That Hates You
qntm.org
qntm.org
"56AA AAAA AAA6 AAAA AAAA 8AAA AAAA AB55 AAAA AAAB 00AA AAAA AA9A AAAA AAA6 0AAA AAAA A96A AAA8 AAA9 A808 AAAA AA9A AAAA AAAB 55AA AAAA A82A AAAA AA97 5AAA AA9A AAAA A6AB 5AA6 AAAA 6AAA AAAA C02A AAAA AABF BEAA AAA9 E9AA AAA9 AAAA AAFE AAAA AD5A AAAA F0AA AAA9 BF00 AAAA AA9B AD56 AAAA FC02 AAAA AABA C02A AAAA AB5A AAAA BAAA AAB6 AAAA AB55 6AAA A02A AAAA A82A AAAA ACAA AAAC 02AA AAAA FE9A AAAF EAAA 9D5A AAA9 6AAA AD57 AAAB C2AA A9BF 00AA AAA6 BBF0 0AAA AABA D56A AAC0 2AAA AAD6 AAAB AAAA DAAA A80A AAAA 82AA AAB5 5AAA B2AA A0C0 AAAA AFDA AABF AA9D 5AAA 5AAA 57DA A6AB C2AA 6FC0 2AAA 6BBF 00AA AAEB 00AA AA03 5556 AA02 AAA8 282A AB0A AAB2 AAB6 AA9D AAB5 02AB 55AA 80C2 AAB0 22AB AAD6 AB55 AA00 AA40 AA79 A"
http://speeddemosarchive.com/forum/index.php?topic=11523.msg...
--- hatetris.html 2010-04-10 03:37:17.491337444 +0100
+++ Downloads/hatetris.html 2010-04-10 03:32:08.264902582 +0100
@@ -65,6 +65,8 @@
var replayOut;
var replayIn;
var replayTimeoutId;
+ var gravityTimeoutId;
+ var gravityInterval = 500;
// draw the current scenery
function drawWell(thisWell) {
@@ -415,6 +417,8 @@
// take user input
document.onkeydown = keyhandler;
+
+ gravityTimeoutId = setTimeout("gravityHandler();", gravityInterval);
}
function showReplay() {
@@ -554,6 +558,14 @@
}
}
+ function gravityHandler() {
+ var down = 2;
+ var gameContinues = transformHandler(down);
+ if(gameContinues) {
+ gravityTimeoutId = setTimeout("gravityHandler();", gravityInterval);
+ }
+ }
+
function keyhandler(event) {
// only handle one key at a time.
@@ -626,4 +638,4 @@
/></p>
</noscript>
</body>
-</html>
\ No newline at end of file
+</html>I particularly like the fact that the author's top score was five lines and he has absolutely no idea whether it's possible to come up with a strategy to beat the machine (it's completely deterministic).
edit: I've been thinking about it some more, and what's interesting is that you ought to be able to analyze it using regular game theory and prove interesting things about it. There must be an optimal strategy for both players, and there ought to be some highest possible score on the assumption that both players play with optimal strategy. Even if this game is too complicated to fully analyze, perhaps thinner games can be analyzed completely? For instance, is it possible for the computer to prevent the player from getting any lines in a 4x4 game? I _think_ two S shapes, a square and an L would do the trick, but I could be wrong. What if it were four wide by eight high?
Now, he may not be implementing his "worst possible piece" algorithm correctly, and it is certainly the case that the requisite sequence of Ss and Zs will take its sweet time about killing you.
[1] "Almost all" is a technical term in probability theory and means "with probability 1" (which is not the same as "all games".)
Where you need the idea is in continuous spaces - like a uniform [0,1] random variable. With probability 1 it's not a rational number, etc.
Really cool though!
replay:
D516 AAAA AAAA B55A AAAA AAA5 D6AA AAA5 D6AA AAAA 95D6 AAA9 5DAA A5D6 AA9D AAAA AAAA 9DAA AAAA A9DA AAAA A9DA AAAB 5AAA AA9D AAA9 7A87 00AA AAAA 956A 0055 BAAA AAAA AEAA AAAA EAAA AAEA AAAE AABA AA0E AAAA AAAB CC2A AA2A AAA9 8CAA AAAA A82E AAAA AAC2 AAAA A0EA AA83 AAA8 3AA8 0CAA AAAA A80D 5540 2A7A A5DA A00E AAAA A80C AAAA A80C AAAA 00DD AAA5 EAAD 55AA BAA8 3FC0 AAA0 4D55 6A9D AA4E A83A A803 DFCE A82A"55AA AAB6 AAAA F6AA AA9A AAA2 AAAA AAAA 009A AAAA AAAA A977 0AAA AAAA A755 AAAA AA40 02AA AAAA AAC0 6AAF AAAA AAC2 6D54 30AA AAAA A805 400A AAAA AAB2 9AAA AA9D AAAA AAAB 0000 2AAA AAA5 AAAA AAA0 AAAA AAA3 0FD5 575A AAAA A94A AAAA AB55 6AAA AAAA AAAA 0756 AAAA 9D56 AAAA 752A AA9D 5AAA 9DAA A756 AB5A A0C3 5EA6 AAAA 0D6A AAAB 2AAA A000 03DC AAAA AA0D 555A 80EA BF4A AAA0 02AA AA83 AAAA 81AB DAA0 05D5 6A80 A9AA 36AA 002A AAD5 5AAB 1A80 AAA0 02AA B5A8 0DAA A8"
Build a tetris clone which forces the player to "win" with 13 lines scored.
I can create a tetris clone that only gives one piece as well.