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.
Okay, can we real quick agree that this is a javascript specific kata?
Nobody else thinks
[] == 0
All other translations here are shitposts IF it is important to the kata that there be mixed types in the input.
However, they are there. So I then claim it clearly is not important, and further does not add anything to the non-js languages. (I'm including coffeescript with js)
Python is mistranslated. In python,
False
is defined to have the value zero. The python translation claims it's not zero. The python translation is wrong. It further allows changing type between int and float which is nonsense.The C# translation already doesn't care.
So then, to fix this:
Option 1: Remove all non-js languages.
Option 2: Remove
False
from python translationOption 3: Pretend the kata doesn't exist and leave it broken.
Option 4: Remove the mixed types.
1: can't.
2: is a band-aid and doesn't change the fact that the javascript translation is a completely different problem
3: really?
4: only option that leaves things in a sane state, ignoring that it is misranked by 2 ranks but that's already the case.
4 further allows accepting translations currently in limbo
I'm making the first step here, with python, and if I get this through, I will continue pushing for the other languages to follow suit (either by painstakingly figuring out how to write them myself or by getting others to do it)
python update: 3.8, new test framework, no more mixed types - list of int only
False
truly has the value0
in python. the kata treats it like a special case (not zero) which I would claim is a translation errorthe
is
operator is not really appropriate here. this isn't about object identity.This comment is hidden because it contains spoiler information about the solution
Of course seeing the code is easier for both of us ;)
Please read this: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution
Don't use
repr
This comment is hidden because it contains spoiler information about the solution
Use only one kind of quotes.
Instead of this:
"'LyfUVC\nGUFjWk\nABpfre\nJMmPrD\ntcVYqC\nooujif'"
return"LyfUVC\nGUFjWk\nABpfre\nJMmPrD\ntcVYqC\nooujif"
.This happened when I tried to solve the rot function:
"'LyfUVC\nGUFjWk\nABpfre\nJMmPrD\ntcVYqC\nooujif'" should equal 'LyfUVC\nGUFjWk\nABpfre\nJMmPrD\ntcVYqC\nooujif'
why? How do I remove the double commas? Using Python