BUT FIRST, WE NEED TO TALK ABOUTRNG
https://www.youtube.com/watch?v=MiuLeTE2MeQ
The video made me curious to try a random number generator, so I tried making a pattern where if the last two bits of a number are even, all bits are shifted to the right and a 0 is added to the left, and the rightmost bit is cut off, but if odd then a 1 would be added to the left instead.
I got this pattern when I started with 1111:
1111 0111 0011 0001 1000 0100 0010 1001 1100 0110 1011 0101 1010 1101 1110
And then it repeats.
Interestingly, that's all combinations of 4 bits exactly once in a cycle, except for 0.
And the pattern translates to:
15 7 3 1 8 4 2 9 12 6 11 5 10 13 14
>>337863483
Just finished this whole thing, holy shit
All that shit for random coin explosions
>>337866337
tech is a-mays-eing
>>337864793
Nerd
>>337866337
AND BLINKING
AND MOVEMENT
>>337863483
fixed
My brain hurts.
I made my own random number generator from scratch in assembly. Made it into a dynamic link library with it's own unique calling convention so silly high level languages can never use it.
>>337864793
The easiest random number generator to understand (that I've found) goes like this:
- take a seed byte, can usually be found by reading a byte of uninitialized RAM at startup if available, just make sure it's not 0
- When the RNG function is called, take the seed number and bit shift in some direction, then XOR by something like $B9
- store this new number to be used in the future
Problem is it loops, so it can be made more random, like by adding the X position of the character to the number.
>>337867393
I don't get it.
>>337867938
Want to know how I know you're a bad programmer?
>>337868043
Well, that's your loss
>>337867393
I've been here way too long
>>337868217
ok, whatever.
*cringe*
>>337867393
Oh God Dammit. Even has the bonus of playing off the PU nonsense from the a presses shit.
>>337867393
>BU not in the variable
ya dun goofd
>>337867393
I'M COMMENTING TO INDICATE I GET THIS
US CHANNERS RITE? XD
>>337863483
>>337867393
>AND result by $0001
>if result is 0, turn left
>if result is 1, turn right
Jesus, is this really that difficult to understand?
>>337868162
Want to know how you're a no fun allowed programmer? I don't give a fuck it was written for myself, not whiny autistic people on /v/.
>>337868418
>*cringe*
OH FUCK THAT WAS EVEN MORE CRINGY NIGGA WHY.