Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
In Python,
import fractions
yieldsfractions == None
. This does not seem to be intentional, so I'm assuming something in the import-prevention stuff is broken.The description states formulas need to be calculated on 'write', not on 'read'. Yet, solutions that calculate on 'read' pass this kata. This means the formulas are pure, and laziness, or deferring the calculation to the 'read' function instead of 'write', is allowed. This behavior should have been in the description all along, but it isn't :/
Very cool kata and on a very important topic, a shame that not more people have attempted it; probably too busy trying to import NumPy - sad!
Test suite has been updated by dolamroth on 2021-09-29 14:55:45 UTC
For those who struggle with this Kata.
RULES OF RETAINING AND UPDATING CELLS:
IMPORTANT - do NOT rollback this change (for the same mysterious reason) and you'll be fine))
no values have to be updated in this case.
First of all, I wish to express my gratitude for a really interesting kata that targets basic graph algorithms.
There are some issues I want to point out:
'A sheet has an infinite number of cells. The default value of any cell is the number 0'
I've no idea what means 'an infinite number of cells'..
Now mysterious zero. Provided boiler-plate code and description forces the value of a cell to be of Object type (and that doesn't seem to be an idea by itself).
And it's impossible to assign 0 to an instance of the Object type. I suggest rephrase it roughly as follows: 'if a cell with a given name wasn't previously initialized, using method write, it has to be given a value of Integer.valueOf(0)'.
I understand that the reason for this decision - desire to make it possible to store any kind of data in a cell. But this requirement has nothing to do with the data structures and algorithms and it pollutes the programing model. So in my opinion, it'll be much better to stick with int as value-type for this task. It'll not change the actual algorithm but the code will be more readable.
fractions
removed from listAccepting floating point numbers now.
Python translation:
Preloaded tests are passed but when running random tests:
I'm returning valid solution but it is rejected:
That's just plain wrong. There is a fundamental difference between passing in
undefined
and not doing so, becausearguments.length
would be different. There are lots of libraries that does this.[CITATION NEEDED]
And anyways, it's also inconsistent with the sample tests.
It's common in JavaScript to check for
argument === undefined
to see if an argument exists,so I thought there is no difference between sending
undefined
and not sending anything,except if you use the the arguments object which is not commonly used
write(name, value)
is called in actual test aswrite(name, value, undefined)
instead, which violates the description the it is called with two arguments only.In fact, the description just overloads
write
with two different functions without specifying how to distinguish between the two. Is it the type of the second argument? Then it should be clearly specified. Otherwise it's pure guesswork.The fixed tests are poorly written: It is written in a way that makes all subsequent test blocks depend on the previous blocks leaving the user object in a correct state. The test blocks should not be highly coupled to each other, as each block should be testing individual things.
Loading more items...