Ad
  • Custom User Avatar

    It gives this weird error on the second random test. Don't ask me why.

    Traceback (most recent call last):
    File "/workspace/default/.venv/lib/python3.11/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/json/init.py", line 346, in loads
    return _default_decoder.decode(s)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
    json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "/workspace/default/.venv/lib/python3.11/site-packages/codewars_test/test_framework.py", line 112, in wrapper
    func()
    File "/workspace/default/tests.py", line 75, in random_tests
    expected = referance(f"https://www.wikidata.org/wiki/Special:EntityData/Q404.json")
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/workspace/default/tests.py", line 59, in referance
    data = refsession.get(url).json()['entities']
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/workspace/default/.venv/lib/python3.11/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
    requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

  • Custom User Avatar
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    for link with id Q42 the description in en and en-us are different (en-us value is taken in the tests, although the instructions say to take the en value). Anyway kata is very interesting, first time working with the API :P

  • Custom User Avatar

    Feedback: I would put in a concise summary at the very beginning. It took me a moment to understand the scope.

    There isn't any mention of what should be returned if the input string is empty. Will this not happen in this kata? If so, maybe mention that.

    Should the quotes preserve leading or trailing whitespaces inside them? Or is that an edgecase that won't exist?

    This looks like a fun challenge!

  • Custom User Avatar

    Hi,

    You're not supposed to copy problems from other websites. Even giving credits, some do not allow it. Leetcode is one of those. Unpublishing.

    Cheers

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Also, wordle word checking is a duplicate of https://www.codewars.com/kata/62013b174c72240016600e60.

  • Custom User Avatar

    Reference solution and fixed tests does not take account of the actual counts of a letter in the solution. e.g:

    guess: PMPF2
    solution: D4WEP
    return values: (0, 1) should equal (0, 2)
    

    There are 2 P in the guess but only 1 P in solution, which in any wordle only 1 of the Ps will be counted yellow.

  • Custom User Avatar

    Some fixed/sample tests have incorrect display text, such as

    test.assert_equals(codewordle("vivid","livid"),(4,1),"guess: vivid\nsolution: lilly\nreturn values")
    
  • Custom User Avatar

    Python function param in initial solution setup should not be input, it's a built-in function and this will shadow the built-in.

  • Custom User Avatar

    I think the kata could be made more interesting if they were cases for leading or trailing spaces and the description should definitely specify the format of the input string given

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This kata is a combination of this and this, hence a duplicate

  • Loading more items...