Bro what the heck
I have an idea. Maybe we set the bits one by one. Say we want to set the nth bit from the right to 0. It represent 2^(n-1). We find the number mod 2^n. If that number is >= than 2^(n-1), then we subtract 2^(n-1). If not, then we do nothing. This might still be too laggy though.
Hmmm… this might actually work!
No idea what you just said. But if @Blackhole927 says it might work, I trust that you are too smart to be true.
WHAT IS THAT!? That actually looks terrifying!
I agree, its probably going to be super laggy
At the top? Its a pure mathematical version of the bitwise operation. We don’t have recursion, but we do have if/else statements, so it’ll be much simpler. A bitwise operation can set bits to a certain state (0 or 1), and do all sorts of things. Black Hole and I discussed it in the comments. I put an explanation of binary towards the end.
Did it work? I really don’t have the patience to build an entire system. I lost it after my voting guide.
Right now i’ve put everything that isn’t chess on hold, so when I finish chess I’ll test it. The math seems sound though.
Chess? Nice. I am working on checkers, which is a breeze in the park compared to chess. Good luck!
So you’re trying to make natural numbers into binary numbers?
No. That’s easy. We’re trying to make bitwise operations, to set each bit to a certain value.
So then you’re trying to convert them to a natural number then do math to that number and then convert it into a binary number.
So we start it in a binary number, and try to set one of the digits to a certain number.
So you’re trying to set part of the entire binary number to a actual number and keep the rest binary?
So I understand part of the problem but why do you need to have this in a game, what game are you going to need to use this?
No. First, binary is a whole other number system, where only 0 and 1 are the digits. Black Hole and I talked about this earlier in the comments, if you want to know the uses.
Ew, checkers. Chess and dominoes on top!