Binary Deployment broken?


#1

Looks like I’ve found some bugs. I’d like confirmation.

1. The wrong answer hints are incorrect

I tried resubmitting for a new random seed, yet it is always like that – saying that the answers should either be either all zeros or all ones which surely are not correct.

2. The level seems unbeatable

Even with the correct answers, it doesn’t give success and the paladins do not say anything.


#2

Really? Mine seems to work fine:

Though I checked the level editor, and getBinary and getTrinary don’t seem to work right…


#3

@trotod thanks for the quick reply. I’m wondering why my level gives “run out of time”. What happens if you don’t fill in the lines for the warlocks?


#4

It says that you pass (the first goal).

Then again, I remember I had one submission that failed for some reason, but submitting it again worked, so wondering what’s causing the problem.

Though your screenshot has nine minions per row. It should only be 8.


#5

Oh damn, I’m stupid! That was the problem, it is passing now. :smile: Thanks.

So scratch the “unbeatable” part, I was just plainly dumb and couldn’t count the padding correctly hahah.

So there’s just a small bug with the wrong answer hints then.


#6

The wrong answer hints also showed all 1s for me most of the time.

Other things:


2 was correct?

My code sometimes summons an extra troop for the ternary rows but it still passes.
Edit: I think the extra troop is because I repeated the same thing that checks if extra zeros are needed from the base 2 code (doesn’t take into account thirds?).
6427 should be 22211001

There shouldn’t be a leaderboard for time if the level ends at the same time for everyone.

The guide could be improved.


#7

2 in binary is 10.
You can easily convert binary to decimal in the JavaScript console:

// parseInt(binary, 2) === decimal
parseInt(10, 2) === 2;
parseInt(1, 2) === 1;

The second parameter to parseInt is the base, so you can use this for trinaries as well as any other base.


#8

I accepted trotod’s patch to fix the answer hints now.


#9

Thanks for the feedback guys. Glad you are enjoying the level. And trotod, thanks for fixing my getBinary and getTrinary.


#10

Although I did get both rewards, I went back and improved my code.

It turns out the mistake for 2 was due to using < instead of <= when checking for the highest power that was smaller or equal to the decimal. Perhaps one of the paladins should always say a random power of 2 to catch these edge cases.

I also fixed the thing that made an extra soldier go at the start of the ternary lines. The extra soldier didn’t affect the goal though.

The answer hints seemed to work this time so kudos to trotod.


#11

Nice! Thanks @trotod.


#12

Unfortunately, it doesn’t look like the patch fixed all of it. My answers aren’t correct, in any case, but, then, neither are the paladins’.


#13

Try running the below in the JavaScript console:

parseInt('01001100', 2)
//=> 76
parseInt('01100000', 2)
//=> 96

They look right to me. :wink: (Seems like your '0' padding is off.)

(Also something weird happened with the Discourse CDN, at least for me I can’t see any image without changing the path.)