• ###### blzzuacommented on "Digit-by-digit number" kata

Python translation

I don't know if it is possible in python not to create an instance of the class or the class itself to be able to address its attributes.

therefore, you have to make the NumClass itself, and in the tests create instance Num = NumClass(), on which the tests are made.

It is also possible to discuss the need to implement dunder methods for comparison (equality), arithmetic. because it wasn't in the original kata.

• ###### EntityPlanttcreated a suggestion for "Digit-by-digit number" kata

JavaScript Translation

I suppose this task was made specifically for Ruby, but you can do the same thing in JS too

• ###### hobovskycommented on "Digit-by-digit number" kata

Do you know what `890625n` is?
Do you know what big integers are in JS?

EDIT: OH I am stupid, and the kata is Ruby only.

• ###### ariw96commented on "Digit-by-digit number" kata

how do i solve this ? expected '890625n' to equal 890625n

• ###### 10XLcommented on "Digit-by-digit number" kata

@Iron Fingers, the random tests call `to_i` to check if the result type is an Integer. Then it calls `to_i` again to check the value, not on the return value of the first `to_i`. If your implementation resets the number on the first call to `to_i`, just cache the last value and return it on the repeat call.

• ###### 10XLcommented on "Digit-by-digit number" kata

Why is there a discrepancy between fixed and random tests?

• ###### user9644768commented on "Digit-by-digit number" kata

(Can you see this ^?)

• ###### Iron Fingerscommented on "Digit-by-digit number" kata

I tried applying the to_i twice in the sample tests and it does work. Like you said applying to_i to an Integer shouldn't return 0 and it clearly is not returning 0 in the sample tests. Not sure what else to try.

• ###### user9644768commented on "Digit-by-digit number" kata

yup, this was after farekkusu's update. the function `to_i` is called two times in random tests, and only once in sample tests.
Just try to get rid of that, you'll be done.

Honestly I don't think this can be treated as an issue, because applying `.to_i` on `Integer` should not return `0`.

• ###### Iron Fingerscreated an issue for "Digit-by-digit number" kata

I am seeing a very peculiar issue. All random tests fail saying that my code is returning 0. However if I try for the same number in my own tests they pass.

Fixed.

• ###### Voilecreated an issue for "Digit-by-digit number" kata

Needs random tests

• ###### Voilecommented on "A tetrahedron of cannonballs" javascript solution

My 2 cents:

While in a "learning" perspective this would be considered "cheating" as it completely misses the (might or might not exist) lesson, it's completely irrelevant to what best practice is. Best practice is simply the most efficient and readable code, period. Showing the explicit form as the best practice teaches you to not blindly applying loops to problems all the time, just like you'd always use good external libraries and built-in objects so you wouldn't have to reimplement everything or write code in a too low-level manner. That's how programming irl works.

• ###### kirushikresolved an issue on "Digit-by-digit number" kata

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

• ###### JadeTuringcreated an issue for "Digit-by-digit number" kata

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