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.
The tests are very small, your code probably wasn't too slow but rather got stuck in an infinite loop.
wording is too C#-specific (and is probably not an appropriate type for C#)
additionally, description does not state that the given positions are for a knight and a bishop, the description thus does not state what the problem to solve is. those pieces could be pawns for all I know from reading the description
it is also a very strange and indirect way of stating that only two pieces exist on the board
It could instead read something along the lines of:
You will be provided with the positions of a knight and a bishop on a board that is otherwise empty (e.g.
[4, "C"]
and[6, "D"]
).That's an interesting situation you found. It's a strange thing to be testing without any corresponding specification - it has purpose but I think the test output should be phrased differently because that's bit of a red herring. If you print out your parameters a b c that should tell you enough to continue.
how so?
Your code is wrong because you rely on approximate values to give exact answers. If your code does produce different results elsewhere then you might be on a different architechture (ARM?) and it would still be wrong even if it should happen to incidentally give correct answers, if that's even the case.
Not sure where my previous comment went. But I was able to successfully solve in JavaScript. Wasn't a kata issue. I wasn't meeting the validity requirements of having AT LEAST one of lowercase letter, one uppercase, and one number. I simply overlooked the lowercase requirement...
Thank you! :D
You are printing instead of returning the results, so by default the
password_gen
function returnsNone
. Do read this on how to write solutions to katas and troubleshoot them on CWHello, when I run my code through VS code it works. But when I test it on here I get this error message:
Traceback (most recent call last):
File "/workspace/default/tests.py", line 9, in
lower = any(c.islower() for c in pwd)
^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable
Please can someone help me?
Merged.
js update
the test logic remains the same but is rewritten to facilitate the clarified failure messages or because I didn't like how it looked at me
JS tests print AFTER assertion
assertion fails -> exception -> print never happens because exception exited the function early -> no information given to solver what's wrong
the python tests are also written this way but that test framework doesn't exit early on failed assertion (it should though, and it could conceivably change that behaviour)
the test code intended to print out failure messages but was written in an incorrect way that used to "work" but now doesn't (specifically there were console.log's after assertions - but a failed assertion raises an exception and thus exits early and skips code after it)
the tests have been updated, they'll now tell you what they don't like.
if you put a space wrong in the output string then it wouldn't be correct any more, that should be entirely unsurprising x)
maybe you'd argue that a space doesn't matter because a human might not see it. but some humans would see it, or it would look weird in some situations. there's also nothing special about space - the problem description doesn't mention words (or more to the point, word separators, space), and if you have logic in your code that is doing things that aren't related to the problem then that might immediately be a hint that it is not the correct thing to do. you could have other characters missing or added, ones that you would see. wrong spaces might also wreak havoc in other parts of a program that relies on disemvowel to behave correctly.
Yeah my code doesn't assure that this mix of "text", "number" always occurs, it just "goes" with whatever input has, just raised the issue because I thought this rule was a rule that the tests always followed. Thanks for clarification ๐
Loading more items...