Ad
  • 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

    so there are 5 tests total. The one I'm failing is the 'validity' test.. Any information on what this is expecting?

  • Custom User Avatar

    in JavaScript:

    Passing all 4 tests(10k passwords generated, testing lengths, testing inequality, testing character count)
    proceeded by 1 fail saying: "Invalid passwords generated!: expected false to be true"

    Is there something I'm missing here?

  • Custom User Avatar
  • Custom User Avatar

    Very nice. my take on this sorted the odds the same. But I really dig the way you handled the data thereafter.

  • Custom User Avatar

    Last test isn't truthey

  • Custom User Avatar

    Nice. I also used a filter with an arrow function. But this elicit function makes it one line shorter.

  • Custom User Avatar

    I really dig the way the alphabet array was created here.

  • Loading more items...