Shadows of the Knight - Episode 1 - Puzzle discussion

hey, try this Bisection method

2 Likes

I think my method is correct within my code, as the first few levels I can pass. However, when I get to the last level, ‘Not here?’, My code crashes due to the load of so much memory. The Arrays I am using will not take the amount of information I need to store a single boolean for each window- there is a heap size error.

Has anyone has simmilar problems? Or do I need to think of a different strategy, or use a different data structure?

Thanks1

(PS: I am using Java, if this helps)

1 Like

Open debug mode, helps visualizing how you should represent different possibilities. One boolean for each window is too much.

Hint: you need only 4 values, whatever the test is

Ok Thanks, I will try another way!

Same problem. =\

Hello, I’m having an odd problem. I pass all tests, including “Test 4 - Tower”:
[screenshoot]. But when I submit my code [screenshoot] it says I failed “Test 4 - Tower”. Why do I pass this problem when testing but I fail the exact same problem when I submit the code?

The arguments you’re using to initialize your BinarySearch objects are slightly wrong and I’m almost sure you’ll facepalm when you find the fix. I don’t want to spoil you, but think about what the starting position implies.

2 Likes

Oh no, I facepalmed myself indeed hahaha… you were right, I was initializing my BinarySearch objects with an index that had already been proved wrong. Now I’m able to pass all tests and to score 100% when submiting. Thanks for your help! (:

ps: I removed the link to my code, because it could be easily fixed and used as a full working solution.

3 Likes

simply check 3 variants of maxCoord-minCoord:
0
1
another

Here is my code.

Edit: No full code :slight_smile:

It passes the Correct cutting validator but not the Correct cutting test.

Note: This is my first post here. Go easy one me. :smiley:

Don’t forget to add +/- 1 in your max() too.
E.G : yMin = max ( yMin , cy+1 );

2 Likes

Thanks. :smiley:

[quote=“inb4broadsword, post:13, topic:264, full:true”]
passed every test, on puzzle choosing screen it says 60\60 CP (whatever that it), 2\2 achievements, but 0% done. why?[/quote]

For me, it’s the opposite : I passed every test. When I send my code, it’s written “Validating your program and computing score…” and nothing happens…
When I come back on the page of puzzle choosing, it says 100% but 0 CP and 0 achievemments.
I suppose I have just to wait ?

(sorry if I made mistakes, I’m not a native speaker)

hi!
anybody willing to supply me some debug info. i implemented some kind of bisection but it doesnt pass the last test. all others get completed but some of them with 0 rounds left. can you post your number of rounds left for each test case so I can compare?

regards

I believe that some people need to write the “max()” equation with an added trick depending on whether their code does integer division via merely truncating the value past the decimal point, as opposed to using float and then rounding up. In C#, “(max - min)/2” will not pass the evasion test.

1 Like

Hi there,

I do not know if this has been mentioned before but some test cases unfortunately do not follow all the constraints provided in the problem statement ( namely “The Tower” and “A lot of jumps” test cases). They provide a width that doesn’t satisfy the condition in the problem statement which is: 5 ≤ W ≤ 10000.

I suppose it was meant to be 1 ≤ W ≤ 10000 for the width constraint.

Happy new year !

yes!
but the problem is more that the compiler this game uses rounds UP always up when using C# when it natively (compiled in VS2015) does round down. this gave me a bit of a headache until i heavily .Error commented my tests.

You really shouldn’t need to create your own 2D array to store all of the values. Just try to work in terms of coordinates. You don’t need to keep track of every spot you’ve checked, just the boundaries of where you’ve checked, which you can do with just a few integers!

I have successfully hard coded the last test.
Has anyone before me did it?

I have noticed if i try to hard code, the expected values of tests changes randomly, but i manage to hard code the results successfully. Do you consider it as a bug?

1 Like

The goal of puzzles is not to hardcode them…
When you submit your code, it is evaluated with different validators than in the IDE.