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.
CoffeeScript random tests sometimes include two or three zero arguments. That's not a valid triangle, and according to the description shouldn't be tested.
This comment is hidden because it contains spoiler information about the solution
Yeah, it does, thanks! I knew that my
zipWith
is garbage, but I thought I would fix the problems in order of their appearance - I have no idea right now how to interweave them folds anyway. The test timing out atsortBy
together with the "single fold" hint threw me off the track. It would be nicer if the tests would only test the performance of what function they are about (or the ones that have already been tested up the list), but I don't know how complicated it would be to change them. A note in the "Performance" part would suffice too. Or even this discussion probably )As an offtopic - have you written a whole new compiler just to make more katas here?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Well, it can be converted and stored in advance... But who cares?
I don't thing proxy should be restricted. Generally it is just a shorthand for creation of a custom getter and setter in proxy for each property in original. Still you have to check if value is a function, which properties should be proxies, think how to cache result for arguments. So it does not simplify main idea. I think it would be even better if warriors could learn about Proxy from their research or other solutions.
OK, I got it. In my solution I used Proxy, so each property/method has to have setter and getter function, and a separate object to store "cached" values and wrapper functions. So there was no need to read values, more than that initial reading added some overhead to initialization. Same could be achieved with normal getters/setters also. But maybe to read all props/methods and choose a correct way to proxy them in advance instead of each access time should work faster since methods access won't cause type and "cachedness" checks.
First I have to say, I really enjoy your katas. They still make me learn some overlooked OOP feature once in a while. It's a shame that so many of them are still in beta.
About this one, I do not understand the first test. Is it really necessary to read all properties during proxy creation? I think the purpose of such proxy it to keep original object and proxied access points in sync having as few accesses to original as possible, so why not check calls count by
<=
? For creation purposes it should be enough to get only keys and postpone getting values until they are actually needed first time.It seems to have no description of method
.destroy
. It can be deduced frommaxPoolSize
andnew
, but still...Also description of
from
andto
parameters is slightly confusing, at least if you read the description from top to bottom. It says that they should be used to calculate rest of properties, but at this point no properties were mentioned yet. Just saying these are initial values for.from
and.to
should make it easier to understand.I don't understand the last statement from this part of test cases:
Description says:
In between third and fifth line 2 real time units have passed and speed was 3. From what I understand, sim time should be
21 + 2 * 3 === 27
. What does lastsim.get() === 21
mean then?Also there is a typo:
array[key] = value || array[key]
, which won't assign 0 or null, but solution still passes.Loading more items...