Shadows of the Knight - Episode 1 - Puzzle discussion

This game is bugged in GoLang, the input failed to be scanned.

So i am a beginner in python and for calculating mid i’ve used typecasting to convert the float value to int, and I believe it automatically rounds off the float value to the integer value, which was weird.

Hey there,

Can anyone help me on this,

I’ve got a perfect score in python and I’ve calculated mid using the following method : return int((position + target) / 2), just returning typecasted int value and if I use round or not it doesn’t really matter.

Well, in php with the same logic round((($position + $target) / 2)) using rounding of values I’m getting all test cases right except on evasive. How does the calculation differs in both languages.

for each location iteration in both cases i am taking mid of the y and x axis and returning the mid value and setting the current value to the returned mid positions, also setting x,y max and min values to the new values.

1 Like

I have used the similar logic,was failing in evasive,thing I used was if I am getting continuous UP,used -gt 3, then increase my difference value.
Reason :- Since we have limited number of moves available and getting continuous UP means we have navigate more towards top.

where is the answer? I’m beginner,and i want to reference a answer.
why the icon of “result”is grey that indicates i can’t hit it to see the answer?

yea, if your code changes in certain ways, the bombs move. makes it impossible to cheat basically.

Think about it this way:
if its below you, your at the max up, (+1)
if its above you, your at the max bottom (+1)
if it’s left of you, your max right (+1)
and if its right of you, your max left (+1)
then split the difference.

I believe you only get to see an answer once you solved the puzzle at 100% percent for the particular language.

So just found out this behaviour is not limited to python but int typecasting returns the value to rounding off to 0. so that’s the reason.

Hey guys I am using Javascript. I am very new to this and am trying to use “if” to check the direction of the bomb however everytime i input “if(bombDir === U)”, for example, I get a reply saying U is undefined. I have also tried other methods but all keep boiling down to the same point that I have no input that I can use to head towards the bomb.

I thought the point was that we would get an input of the bomb direction which we could then use to help batman find the bomb?

Can someone please help?

Are you checking whether bombDir is equal to the letter U or equal to the value of a variable named U?

Hi All ! I’ve been having trouble with the last test ‘Not There’? My algo is too slow, and it will need one more turn to defuse it.
I can see it splitting the search space of the binary search properly, so I don’t know how to improve it.
Is there any trick for the last one or maybe a missed something on my code?


I don’t know why my code doesn’t work…
Any help please?^^

define “doesn’t work”. Do you have a runtime error? Does it timeout? Does Batman fail to reach the bomb in due time?

7 assignments for 7 test cases…

U is a letter, you have to check it like if (bombDir === "U") {...}

Can someone give me advice, how to solve this puzzle correctly? :smiley:
Wrote “binary-search” similar code, passed 5/7 tests, but after submit system writes, that I passed only 2 tests and the others are hard coded :roll_eyes:

For python, I used math.ceil() instead.
math.ceil(0.5) --> 1
math.ceil(1.5) --> 2

Hi, I’m wrong. When I did condition avec if in language C for recognize the movement like (U,UR,L,D,R…), my character move in the same way.I don’t understand why!!! Can you help me to get it?

if it moves the same way, it means your code doesn’t properly take into account the different inputs. You should check you correctly read and use the inputs, every turn.