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.
What do you mean by "optimization"?
Both
.description
andString()
work the same way for integers - String initializer, Integer descriptionEdit:
Oh, I've noticed what you meant -
number.description.sorted {...}
? Not sure about optimization, but easier to read for sure.Swift translation please review.
Swift translation please review
Swift translation please review :)
You are welcome :)
Well, no.
$N
values are values inside the closure. To accessstart
orend
just usestart
andend
inside the closure.If there are a single parameter inside the closure, only
$0
will be available. As an example -.filter(...)
could be written as:With this you can't access parameters with
$0
, but can with it's name -item
.For example
.sort(...)
method uses 2 parameters inside, so this:Is the same as this:
I guess it will be easier to understand if you read about
Shorthand Argument Names
at: Swift BookYup, every
$N
parameter is a parameter inside the closure.$0
represents a first parameter passed to the closure.If you switch
.filter
with thefor item in (start...end)
, then$0
would represent anitem
parameter, notstart
.So
$0
,$1
and so on represent a parameters withing a closure scope.I've translated this kata to swift: https://www.codewars.com/kumite/582edc8c2029ea0319000116, please review
I've translated this kata to Swift, please review: https://www.codewars.com/kumite/582da07f5f867798b3000353
I've translated this kata to Swift: https://www.codewars.com/kumite/582d9d9906e37fe2f8000c97, please review
I've translated this kata to
Swift
, please review: https://www.codewars.com/kumite/582d9b702de6d9a412000158Sure, when i got the time :)
There are a lot of stuff going on lately.
Updated :)
I've made a translation for this Kata to Swift: http://www.codewars.com/kumite/58170668ca72bac0b6000087 please review :)