Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This is my favorite solution so far since it thinks of an IP address, first and foremost, as just an alternate representation of a 32-bit integer where the answer to the kata is a simple subtraction.

    Wish I'd remembered to think of the IP address as just a 32-bit integer as well. :)

  • Custom User Avatar

    I see where you're going with an OO solution, but since the only functionality that this class provides is (a) storage of an IP address as a 32-bit integer and (b) the subtraction of two 32-bit integers (two IP addresses), it's a bit over designed.

  • Custom User Avatar

    Ah, you're right - I misread the description. It's given as a Time in the Ruby example. My mistake. It's only given as a Date in JS/CoffeeScript.

  • Custom User Avatar

    This shouldn't work, since the kata says that the *_time variables are given as a Date, and the standard lib does not have a Date::to_i method. However, I see many other passing examples...weird.