u/Perfect-Highlight964
- 131points
Perfect-Highlight964
Perfect-Highlight964
If you use base 10, since 2,3,4,6 are divisors of 10, if you want to check whether a number is divisible by any of them you just check that the last digit is a multiple of them, and if you want to divide by any of them you can just multiply by 10/x and remove the 0 at the end [or add a .], (e.g. 43 is divisible by 3 because 3 is divisible by 3 and 10/3=4 so 43/3=43×4/10=150/10=15)
Edit: It may seem obvious for such small numbers but imagine you need to calculate something like 55673/3, it's not obvious how to divide it into parts to do the division, but it's quite easy to do 50000×4+5000×4+600×4+70×4+3×4 and remove the zero at the end
Perfect-Highlight964
No it's not, 10 has 5 factors not including 1 (2,3,4,6,10) while 12 has only 3 (2,7,12) so in most cases it's easier to divide and multiply in base 10...
Perfect-Highlight964
הפסיכיאטר המחוזי
Perfect-Highlight964
Oh yeah, I know this one this is truly amazing
Perfect-Highlight964
Could fix it but I don't want the crc calculation to make the code twice as long
Perfect-Highlight964
Could do that, but that would mean a repo with hundreds of almost identical files...
Perfect-Highlight964
Thanks
Perfect-Highlight964
QR Codes are divided into "types" the smaller the QR it could obviously hold less information, they come in "sizes" 1-40. Version 2 can only hold 32 bytes and version 1, 17 bytes.
Perfect-Highlight964
Thanks
Perfect-Highlight964
x86 assembly
Perfect-Highlight964
Lol, I actually dropped it off for a year and suddenly remembered it, so I thought I could maybe reduce some more bytes with a "fresh look".
Perfect-Highlight964
Not that I know of
Perfect-Highlight964
Because of MattKC's video where he tried to do the same
Perfect-Highlight964
Damn, didn't notice, thanks!
(If I weren't pedantic as well this project wouldn't go anywhere passed 130 bytes)
Perfect-Highlight964
In nibbles there's no food mechanism and in most versions no walls, so you could go right through the bottom/top and the snake just continues to grow one pixel each frame
Perfect-Highlight964
I don't tell anyone (almost) actually, not because I hide it but it just never came up, my girlfriend knows about it and is a little interested but she won't go as far as reading the code or something.
Perfect-Highlight964
Awesome
Perfect-Highlight964
Shit, answered yesterday but it bugged or something,
1. the collision detection is based on the former tile not turns so it's problematic to reduce, could elongate the snake to solve possibly
2. could actually use a different value for the ADC instead of dh (0x22,0x23,0x24,0x26,0x28,0x2a,0x2b,0x2c,0x2e,0x2f,0x30,0x32,0x33,0x34,0x36,0x38,0x3a,0x3b,0x3c,0x3e) or even switch to SBB (with either 0xc3,0xc4,0xcb,0xcc,0xcf,0xd0,0xd3,0xd4,0xdb,0xdc) or even use a different opcode instead of or al, 0x29 to form mov [si], dl which would give many more values to put there, which means I would be able to adjust the entire main loop to solve it but those are a bunch of options to go through and I don't have the time, might do it sometime
3. yes, this is the result of handling input with arithmetic and not branching, I expect users to only input valid keys
Perfect-Highlight964
True
Perfect-Highlight964
The logic is to handle input from PC only, the web version converts mobile input to PC input to allow playing from mobile
Perfect-Highlight964
I'm going to be a bit busy in the next couple of days, but might add it afterwards
Perfect-Highlight964
It won't matter version 3 is at maximum 53-bytes
Perfect-Highlight964
It's complicated to explain, you'd better read the code if you're interested
מקור?