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 used my previous solution ;)
#you can use this code for less confusion
is_even = lambda a: a%2==0
The left side of the comparison determines if the variable is NOT an "existing"
true
or an "integer""not a decimal
", the result isundefined
If the left of the comparison fails, then we move to the right comparison
If the integer is odd then return false, else return true.
0 is False and 1 is True
do you want it to return 0 when not even, and 1 when even?
Because this is kumite. Here it's about showing off skills related to the knowledge of tricks to reduce the length of the code as much as possible, I think. Of course, in "normal" code readability is very important.
Why you dont return simple undefined instead od {}.a ?
I mean:
isEven=n=> n%1==0 ? !(n%2) : undefined
and this is more readability. When you put some whitespace beetween
0
Well done! I didn't know the trick {}.a for undefined...
*chef's kiss* now with 100% less
ord()
!great minds! I edited the previous fork + added some regex to strip leading spaces and comments
The more you know about obscure inline ASM hacks... :D
Thank you! :D
nice one
Still, mine is shorter mwehehe
Loading more items...