Shadows of the Knight - Episode 1 - Puzzle discussion


#126

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


#127

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.


#128

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.


#129

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.


#130

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?


#131

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


#132

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.


#133

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


#134

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.


#135

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?


#136

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


#137

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?

Thanks


#138

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


#139

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


#140

7 assignments for 7 test cases…
Suspicious…


#141

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


#142

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:


#143

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