Ad
  • Default User Avatar

    George lives on the ground and wants to send a number in binary to Isaac in the ISS by painting giant dots in his yard.
    Thankfully, George and Isaac have done this before, so George's yard already has a bunch of dots painted.
    Each dot will take a single bucket of paint to change.
    Given George's yard's current number in decimal and the target number in decimal, how many buckets of paint should George buy total?

  • Custom User Avatar

    Which test? there are litterally two types of tests and 6 tests in total.

    If you mean the example test case then I already fixed it and it should be correct if you do the Kata again.
    EDIT: Don't know how or why, but I just fixed it, again.

  • Custom User Avatar

    The Elixir test is wrong, perhaps you could update it to reflect the description?

  • Custom User Avatar

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

  • Custom User Avatar

    I actually feel that "hard coding" the scores is a great idea - its simple and easy to understand and update in the future. In my opinion this wins hands down over any "clever" solution for real world coding problems. Great lateral thinking!!

  • Custom User Avatar

    This one actually took me several days and I've learned heaps so thankyou for that. I'm glad I went through the process of learning about Primes and writing my own sieve and generator, but its a quite dissappointing to find out use of the stdlib "prime" class is allowed. In my opinion that drastically reduces the real lessons to be learnt here.

  • Custom User Avatar

    Why did you change these variables to class variables (@@).
    This would mean that all instances of person would share the same values.
    This is clearly not the intent of using a class to define the data.

    Your solution would fail with this following test:

    p1 = Person.new('Yukihiro', 'Matsumoto', 47)
    p2 = Person.new('Keith', 'Salisbury', 40)

    Test.assert_equals(p1.age + p2.age, 87)

  • Custom User Avatar

    I think the tests should be enhanced, because one of the solutions someone has provided uses @@ class variables, which passes tests, but would fail a test like this:

    p1 = Person.new('Yukihiro', 'Matsumoto', 47)
    p2 = Person.new('Keith', 'Salisbury', 40)

    Test.assert_equals(p1.age + p2.age, 87)

  • Custom User Avatar

    Nice one, I like javascript like this!

  • Custom User Avatar

    brilliant, so simple when you know how!

  • Custom User Avatar
  • Default User Avatar
  • Custom User Avatar

    First class!!! I was stumbling around this idea but it was staring me right in the face and I just didn't see it. Bravo!!

  • Custom User Avatar

    I've only just joined this website and there was absolutely no mention of "all katas in the series....blah blah blah" so it is in no way clear that the tests may include whitespace. I ended up having to print out codepoints you hid to uncover what you hid in the test. I fully accept that the final solution encourages best practice, but because the failing example is unaccessible I find this Kata to be more trickery than healthy education. Be upfront and honest. Its the fact that you hide this test that makes it sneaky and deliberately deceptive. But thats just my opinion, you obviously have your own opinion.

  • Custom User Avatar

    Nice, didn't realise we could change the Node api, but love your solution.

  • Loading more items...