Shadows of the Knight - Episode 1 - Puzzle discussion

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

1 Like

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?

Thanks

Hi,
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ā€¦
Suspiciousā€¦

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.
e.g.
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.