Ad
  • Custom User Avatar

    Fixed tests should contain a word with 6 letters.

  • Default User Avatar

    What constitutes a letter? -> elaborated more on that.
    What constitutes a punctuation? -> again, elaborated more on that.
    Description does not mention that stripping the essay and removing unnecessary spaces or their equivalents is required -> I made it so that doesnt happen (to my knowledge).
    No example tests -> I added some (if you consider the tests I added as such).
    Assertion messages exist for a reason, that is to not pollute the namespace with excessive printing, which is bad practices. -> I completely reworked the random tests, it no longer prints anything to the console.
    Also in-accordance with statement right above and issue below, no one is going through that piece of essay for the sake of debugging, so with or without the assertion messages is deemed useless (No wonder Bob is struggling so hard though...) -> This one is on me xd, but I changed the random tests to be shorter and more readable, rather than the long block of text it was before.
    Also also.. string manipulation is a duplicate and has been done to death -> Any suggestions? I usually do not mess with tags. I did not know that "string manipulation" was done to death, so I simply removed it.

  • Default User Avatar

    Yeah, I thought that was going to be an issue like 20 minutes after publishing, but I couldn't really find a computer to change it, so here I am. I fixed it by creating more example tests, short random tests, and some long random tests.

  • Default User Avatar

    came here to say just that

  • Custom User Avatar
    • What constitutes a letter?

    • What constitutes a punctuation? (Based on tests, it seems to be limited to .,?!;: only.

    • do not include periods in this however

      should be periods punctuations

    • Description does not mention that stripping the essay and removing unnecessary spaces or their equivalents is required

    • No example tests

    • Assertion messages exist for a reason, that is to not pollute the namespace with excessive printing, which is bad practices.

    • Also in-accordance with statement right above and issue below, no one is going through that piece of essay for the sake of debugging, so with or without the assertion messages is deemed useless (No wonder Bob is struggling so hard though...

    • Also also.. string manipulation is a duplicate and has been done to death

  • Custom User Avatar

    You can't just throw a long essay composed of random words and expect user to just debug what's wrong with their solution easily when it doesn't match. Please, start the random tests with short input first.

  • Default User Avatar

    Alright, I fixed the random tests. I think the issue was that I made the input for the function global, and I technically accessed it in my solution function. I made the inputs local.

  • Custom User Avatar

    I didn't know that modifying the table instead of creating a new one caused problems

    It causes problems because your tests are written improperly, because your reference solution directly modifies classes, returns it, then uses it as the expected value in the test assertion, then passes the modified value into user function, all at the same time.

    This has nothing to do with Lua. This has to do with fundamental coding concepts of object ownership and mutability (and why you don't mutate inputs you receive without knowing what you're doing).

    could you give an example of your issue

    Try

    function balance.balanceClasses(classes, players, modifier)
      return classes
    end
    

    This passes all the random tests.

  • Default User Avatar

    Honestly, I am not the best at Lua, so I didn't know that modifying the table instead of creating a new one caused problems. Also, could you give an example of your issue, because a class's stats can sometimes remain the same (as in the example provided).

  • Custom User Avatar

    The return value should be the modified classes variable

    This is where your problem comes from. Why did you decide to ask to modify a table in place rather than returning a new table? This causes more problems than what it's worth.

  • Custom User Avatar

    Random tests are broken: the expected value is exactly the input classes instead of the actual answer.

  • Default User Avatar

    I completely changed the description to be more guiding, I hinted at Math.min() in it.

  • Custom User Avatar

    So when exceeding the length of any of the string arrays, we need to take the last string of that array.

  • Custom User Avatar

    I don't even see it in started code. I was performing % format[i].length.

  • Custom User Avatar

    (edit) I see now that it is in the starter code, but that doesn't preclude stating it explicitly in the description.

  • Loading more items...