Bitwise operations in gimkit

Blizzy’s DoD padlet

3 Likes

ah
sure

1 Like

Okay, @blackhole927 said this about the code:

2 Likes

According to the post, I’m assuming that BlackHole wanted a solution for the specific number, not a general formula. (if i misunderstood this pls tell me)

So basically, since we’ve found out the results for each case, we just create a block of code for each result. The block code does NOT perform the Bitwise AND operation. We’ve pre-done the Bitwise AND operation. (if i misunderstood this part pls tell me. Maybe i was supposed to perform the Bitwise AND operation in the block code?)

Case 1: n is greater than 32

We’ve found out the result of the bitwise AND operation, which is 0

The block of code that corresponds to it:

If {n>32}

Do [set property: result

[value: 0

Case 2: n is odd and less than 32

The result from this case is 2^n. Since we’ve already checked for “greater than 32” in the previous block code, we dont need a second condition.

Block code for this case:

Else if {n is odd}

Do [set property: result

[value: 0

Case 3: n is even and less than 32

Result is 0.

Block code:

Else if {n is even}

Do [set property: result

[value: 0

Case 4: n is 0

Technically this is already included in the previous block code, since zero is even.

Case 5: n is negative

Since we’ve already been through every other possibility, we don’t need more block code

A single “else” is enough

Else

Do [set property: result

[value: 0

To simplify this further more, we can instead do this:

If {n is odd} AND {n<32}

Do: [set property: result

[value: 1

Else

Do: [set property: result

[value: 0

3 Likes

That is actually so true.

3 Likes

i think i misunderstood this problem

1 Like

19 likes?! for one word. crazy.
Now back on-topic

6 Likes

guys, i think what blackhole needs is to have a system that actually converts numbers to base 2 and performs the bitwise AND operation during the game, not pre-doing the results and inputting it in

so:

  1. we need a system to convert numbers to base 2 (or any other base)
  2. we need a system to perform bitwise AND operations (or any other operation)

why are we talking about art?

i accidentally refreshed the dod padlet. pls tell me the new password.

1 Like

Um, why do you need this anyways, @Blackhole927

Oh, I will need to wait until June:(

He wants it so he can make a color screen in GKC.

2 Likes

Read the links on the first post, and don’t announce your age.

1 Like

Also read the comments. I asked the same exact questions and bh guided me through it.

1 Like

I would delete that if you don’t want to be banned

They asked to be suspended.

Oh, okay then, that’s somewhat ironic

1 Like

I totally just understood the equation up there… no cap

What it the code for it tho, at first it didnt need one then it did and I knew it but now it is changed.

The code for Blizzy’s padlet has changed because the password was leaked.