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.
Great kata!
Any progress on the Ruby front? I started coding my solution without paying attention that Ruby was not in the list :-(
It looks like my ruby port of this kata is flawed; I'm going to pull it until I can figure out what's wrong. Thanks for the heads up.
Thanks for the advice. I used
parseInt()
becausebase + (+cards[0] || 10)
looks funny; I didn't realize it made a difference, but having read your other comments on this kata I will useNumber()
in situations like this in the future.BTW, it's friendly to give people reasons to do the things you tell them to do, or at least a link to something you consider a good explanation.
Hmmm. I starting writing a long rant about different ways of converting strings to numbers in JavaScript. I'll save you from reading all that. Especially since you seem familiar enough with JavaScript to know how inconsistent it is, already.
Thanks for the link. The big floating-point problem was new to me.
What is your opinion on
parseFloat
? It works likeNumber
except for translatingnull
toNaN
and not to0
. And since you don't have the radix parameter, it's safe to use withmap
.Thanks for the idea. I wasn't sure that unary plus returned
NaN
for non-numbers, but it seems it does. I still like thatparseInt
makes it very explicit that there is a conversion taking place, but I agree that the radix should be specified.I'll use unary + for a while and see how it feels. :-)
I must have missed that the first time I read "JavaScript: The Good Parts". Thanks for reminding me.
I actually did it like this. But I think who made this kata should make a test like the one you mentioned so that other users will fail when trying it.
The rules haven't changed. It seems that there is a bug causing data loss with denormalized data (increment/decrement changes). To be clear, the data is there, but we use nosql so we incrementally update denormalized copies of the points for efficiency. When your profile's points/ranks got rebuilt using normalized data they were properly adjusted.
Fixing this so that everything is consistent and real-time accurate is my highest priority right now.
This is an interesting point, I think I'll make a second kata. Thanks!
This comment is hidden because it contains spoiler information about the solution
+1 for the unary remark. I never knew that.