Ad
  • Custom User Avatar

    Dude out here, writing a fully documented and performance tested code snippet for one kata.

  • Custom User Avatar

    I have no idea what's happening here, beside you creating a bit field and check if all necessary bits are set.
    That's pretty convoluted, but as long as it works, I guess.

  • Custom User Avatar

    I combined the most clever rated answer, after I solved it overly complicated with some conversion methods and math.

    Originally I converted the directions to opposing numbers (1, -1) and (2, -2) to mathematically cancel them out more easily.

    The stack approach of the best rated answer however, was so nice and short, that I took it, and some other ideas from its comment section, and shortened it as much as I could.