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
Show HN: Tetris, but the blocks are ARM instructions that execute in the browser
51–56 of 56 posts
Re: Show HN: Tetris, but the blocks are ARM instructions that execute in the browser
#52Earlier 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…
Re: Show HN: Tetris, but the blocks are ARM instructions that execute in the browser
#53I'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!
Re: Show HN: Tetris, but the blocks are ARM instructions that execute in the browser
#54Re: Show HN: Tetris, but the blocks are ARM instructions that execute in the browser
#55I tried navigating https://ofrak.com/docs/environment-setup.html, but couldn't find anything specific about the tetris games. Perhaps I miss that?
Re: Show HN: Tetris, but the blocks are ARM instructions that execute in the browser
#56I 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.
I got around 2 billon a couple of times but the average is quite low ;)