[Community Puzzle] Is the King In Check? (Part 1)

Hi there, my code fails validator 4, and I’m unsure why..

Earlier it also broke on Q and test cases 5, but once I switched to lists it seem to work fine, am I missing some specific quirks?

[Mod edit: Please avoid sharing your code in the forum.]

Check your code for all possible cases for a knight.

I’ve only checked quickly but I believe your current code only successfully finds the results of the X positions for a knight:

_ _ ? _ ? _ _ _
_ ? _ _ _ ? _ _
_ _ _ N _ _ _ _
_ ? _ _ _ X _ _
_ _ ? _ X _ _ _
_ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _

…now that you mentioned that I realized my problem quickly- Thanks

1 Like