Bitwise operations in gimkit

image

2 Likes

Bro what the heck

image

1 Like

Yes this is still clay-institute

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.

3 Likes

Hmmm… this might actually work!

3 Likes

No idea what you just said. But if @Blackhole927 says it might work, I trust that you are too smart to be true.

2 Likes

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.

1 Like

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.

2 Likes

Chess? Nice. I am working on checkers, which is a breeze in the park compared to chess. Good luck!

2 Likes

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!

1 Like