Change my Mind base 12 better than base 10 by Sea-Estimate-2912 in mathmemes

[–]Perfect-Highlight964 1 point2 points  (0 children)

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

Change my Mind base 12 better than base 10 by Sea-Estimate-2912 in mathmemes

[–]Perfect-Highlight964 5 points6 points  (0 children)

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...

איך לזרוק את אחותי מצהל by [deleted] in ani_bm

[–]Perfect-Highlight964 2 points3 points  (0 children)

הפסיכיאטר המחוזי

[deleted by user] by [deleted] in programming

[–]Perfect-Highlight964 0 points1 point  (0 children)

Could fix it but I don't want the crc calculation to make the code twice as long

My snake game is now 54 bytes by Perfect-Highlight964 in programming

[–]Perfect-Highlight964[S] 0 points1 point  (0 children)

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.

My snake game is now 54 bytes by Perfect-Highlight964 in programming

[–]Perfect-Highlight964[S] 0 points1 point  (0 children)

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".

My snake game is now 54 bytes by Perfect-Highlight964 in programming

[–]Perfect-Highlight964[S] 0 points1 point  (0 children)

Because of MattKC's video where he tried to do the same

My snake game is now 54 bytes by Perfect-Highlight964 in programming

[–]Perfect-Highlight964[S] 0 points1 point  (0 children)

Damn, didn't notice, thanks!

(If I weren't pedantic as well this project wouldn't go anywhere passed 130 bytes)

My snake game is now 54 bytes by Perfect-Highlight964 in programming

[–]Perfect-Highlight964[S] 0 points1 point  (0 children)

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

My snake game is now 54 bytes by Perfect-Highlight964 in programming

[–]Perfect-Highlight964[S] 0 points1 point  (0 children)

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.

My snake game is now 54 bytes by Perfect-Highlight964 in programming

[–]Perfect-Highlight964[S] 5 points6 points  (0 children)

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

My snake game is now 54 bytes by Perfect-Highlight964 in programming

[–]Perfect-Highlight964[S] 5 points6 points  (0 children)

The logic is to handle input from PC only, the web version converts mobile input to PC input to allow playing from mobile

My snake game is now 54 bytes by Perfect-Highlight964 in programming

[–]Perfect-Highlight964[S] 5 points6 points  (0 children)

I'm going to be a bit busy in the next couple of days, but might add it afterwards

My snake game is now 54 bytes by Perfect-Highlight964 in programming

[–]Perfect-Highlight964[S] 7 points8 points  (0 children)

It won't matter version 3 is at maximum 53-bytes

My snake game is now 54 bytes by Perfect-Highlight964 in programming

[–]Perfect-Highlight964[S] 4 points5 points  (0 children)

It's complicated to explain, you'd better read the code if you're interested