Ad
  • Custom User Avatar

    I agree that it's not always good, but it's not always bad either. Just got to make sure it's clear, and you don't need to rewrite or change it later.

  • Default User Avatar

    one line obssesive people >:(

  • Custom User Avatar
  • Custom User Avatar

    no man i did this so short .. fckk you win :( . Thats a insane approch :) gg

  • Custom User Avatar

    I believe the idea (Chris'one) is rather to say in the description that: Is considered mispelled any word that matches the first element of a subarray.

  • Custom User Avatar

    It is defined in the 2-dimensional array words that is given as an input (its a 7kyu after all).
    Example:
    "badword" is the wrong word and "correctword" is the correction to it
    then the array would be [["badword","correctword"]]

  • Custom User Avatar

    Can you define a mispelled word here? How different does it have to be from the correct word to be classified as a mispelling? e.g. I'm thinking of hamming distance or some other metric

  • Custom User Avatar

    Fixed it.
    Youre right about the empty array, changed that too.
    The random test already generates empty lists

  • Custom User Avatar

    will do that

  • Custom User Avatar

    (well, you made it very inefficient, but I guess that won't be a problem here... ;o )

    seems ok, yes... Mmmh, actually no. The tests with empty lists are incorrect:

        test.assert_equals(switch("", [[]] ),"")
        should be:
        test.assert_equals(switch("", [] ),"")
    

    and you need to enforce (or at least "allow") the random tests to produce those empty lists too, from time to time.

  • Custom User Avatar

    Thank you for the feedback, completly overlooked those points.
    I think I fixed everything now.
    (please correct me if im wrong)

  • Custom User Avatar

    Hi,

    • you need fixed tests in the "test cases" part too, before the random tests.
    • no need for the nested describe block
    • the random tests should generate random replacement lists too (with random length, I mean). Warning with that: you'll have to make sure that all "mispelled words" are unique in that list and that no "corrected word" matches a misspelled one.
    • missing tests where no words are to be replaced
    • missing tests where the same incorrect word appears several times
    • maybe test with an empty replacement list too

    cheers

  • Custom User Avatar

    the random tests randomly generate words + sentences out of those words
    (I hope I understood you correctly)

  • Custom User Avatar
  • Custom User Avatar
  • Loading more items...