Ad
  • Custom User Avatar

    The tests are very small, your code probably wasn't too slow but rather got stuck in an infinite loop.

  • Custom User Avatar

    You will be provided with two object arrays.

    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"]).

  • Custom User Avatar

    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.

  • Custom User Avatar
  • Custom User Avatar

    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.

  • Custom User Avatar

    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...

  • Custom User Avatar

    Thank you! :D

  • Custom User Avatar

    You are printing instead of returning the results, so by default the password_gen function returns None. Do read this on how to write solutions to katas and troubleshoot them on CW

  • Custom User Avatar

    Hello, 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?

  • Custom User Avatar

    Merged.

  • Custom User Avatar

    js update

    • changed console.log to assert.fail
    • changed failure messages so that they explain what is tested to avoid frustrating vague failure messages (this comes at the cost of making the kata somewhat easier as it removes the need to figure out the problem, but I'll take that over being vague)

    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

  • Custom User Avatar

    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)

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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...