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.
😂
This changes the array as well.
done
Not a kata issue.
Help us help you. At the time of writing, this kata is available in eight languages, each with their own tests.
Specify which language.
If you're talking about the Example Tests, you may have to write them yourself.
Closing.
Changed the description and added sample tests to eliminate the BS-factor
No random tests
Your sentence doesn't make much sense, and it isn't really an issue.
Anyways, to properly compare objects and arrays you should use
Test.assertDeepEquals
(because, as every CS 101 lessons will tell you, object reference and object content are two totally different things.)this is what I had:
Pressing 'run examples' gives errors like: 'expected [1,2] but got [1,2]'.
But pressing 'attempt' gives tests passed!
Aaaand the kata was ported to Haskell. So I could port my solution right back, and d*mn if it doesn't look like real Haskell.
Higher order functions FTW.
Seriously, I'm not going to explain it in detail. Maybe one day you'll figure it out by yourself, and the light will be blinding. :P (After I wrote this, it was for me.)
Three things to keep in mind.
Function.on
and the thirdsumPPG
are actually in use. (I needed the earlier definitions to make things clear to myself.)Function.on
andplus
return functions.sumPPG
s are identical. The third definition is what is called point free; it does not mention its arguments (it still has them though). This goes back to point two:plus.on
returns a function, so I can definesumPPG
by assigning itplus.on()
.The idea for this comes from Haskell, which I am just learning still myself; I recognised a pattern with
on
and figured it out by coding it myself. This took me a while!extract
is curried, another idea from Haskell (which itself takes it from Lambda calculus), which allows partial application and point free style.Yes, there is a whole lot happening here. It's a generalised (you could feed it more than two arguments, and it'd still work as you'd expect), rather advanced solution to a quite simple exercise. Too much to explain really. Which is why I don't. Apologies for that, but I just don't know where to start and I'd need to explain too many meta things.
In the JavaScript version there are no test cases, but even when I write them, Expected: [2], instead got: [2] ~ I'm not advanced enough to debug this, but it's definitly not functional or robust.
WOAH!!! What is happening here! Please explain 8 )
Better throne... but https://www.youtube.com/watch?v=AXAnxAA73xM&feature=youtu.be&t=3m46s : )
you are right! https://www.youtube.com/watch?v=Pkyy57iMaB0 , let me change that. And by the way the iron throne it's more importan than be the king of the north :P
Loading more items...