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.
You just taught me how to use reduce, thank you!
as newbie i could have an aproach. I think the key to understand this, is know that Math.sign() return an integer ; -1 (negative), 0(zero), 1(positive). Then uses this to calculate the proper index of the list [3,4,2,1][index] where index = (0,5 if x is pos OR -0,5 if x is neg) + (0,5 if Y is neg OR 2,5 if Y is pos) it always result into an integer form 0 to 3 that selects the value in the arbitrary order is set.
too much maths
can you explain
took me a minute to understand but i overall like the way you did this problem
great code and cool name! id say make the code look a little prettier though so its more readable
i like this code
i realize now that i couldve swapped the if statements to use less code lol
favorite answer