Live data from Hacker News

Show HN: Tetris, but the blocks are ARM instructions that execute in the browser

ofrak.com

51–56 of 56 posts

Re: Show HN: Tetris, but the blocks are ARM instructions that execute in the browser

#51
post #28
post #27

Earlier quoted context omitted.

Uses the Gamepad API. I found it very easy to work with, in large part thanks to the corresponding MDN docs. The only weird part about the Gamepad API is that you have to poll it rather than handling events the way you normally would for other, similar stuff in JavaScript. In practice, this means that you have to do your own debouncing for handling things like key combos, but that doesn't really affect individual but…

Magic, thanks! Which model mat do you have? It might be worth trying with WebHID instead of the GamePad API. Quick example with a joystick :) https://murkle.github.io/utils/webhid/logitech_attack3.html

... and a quick example with a very cheap USB Dance Mat https://murkle.github.io/utils/webhid/dance_mat.html

Re: Show HN: Tetris, but the blocks are ARM instructions that execute in the browser

#52
post #43

Earlier quoted context omitted.

> Your score is stored in memory at the address pointed to by R12 As someone who has very little idea of what instructions or addresses are, what is this a reference to? Edit: I had the page loaded before your reply, so I didn't see it until I replied, reloading the page lol

It's not a reference, it's just a really neat game mechanic. Normally the high score is guarded by the game and changes only if the game deems it fit to change it. In this game, because the high score is accessible within the game and you can execute arbitrary instructions, you can use that to modify the high score. It's as if in a more normal game the high score was kept in a big chest somewhere in the game world an…

That game is Zelda on N64

https://www.zeldaspeedruns.com/oot/tech/get-item-manipulatio...

https://www.zeldaspeedruns.com/oot/ba/reverse-bottle-adventu...

Re: Show HN: Tetris, but the blocks are ARM instructions that execute in the browser

#53
post #7

I'm computer literate (and know some basic assembly) but wow I did not get it

Hey, any specific questions? I'd be happy to explain anything that needs clarification. More broadly, any thoughts on how to make the game clearer? I know that a manual describing the instructions would help. But other ideas are welcome as well!

You could add a puzzle mode with a fixed set of instructions introducing gameplay elements like rotate after a few puzzles to make it easier and more interesting to learn the game. My first play, I got a lot of sub instructions and my registers had all zero value. It was somehow partly pointless: Should I rotate and do sub R1, R2, R3 or do sub R2, R3, R4 to get a nop somewhere ? ;) XD

Re: Show HN: Tetris, but the blocks are ARM instructions that execute in the browser

#56
post #45

I really like the concept! The key to achieve high scores seems to be writing 0 to PC. The reason is the binary code of new instructions will be "added" to the memory region that is visible on the right, then we can manipulate R12 to maximize the score.

Ah, another key is to change R12 to a number that is not divisible by 4. This is because every instruction is 4 bytes and the most significant bit is always 1.

I got around 2 billon a couple of times but the average is quite low ;)

Post reply on HN