6 kyu

Walter's miraculous FizzBuzz factory

78 of 664bkaes
Description
Loading description...
Arrays
Fundamentals
  • Please sign in or sign up to leave a comment.
  • farhanaditya Avatar

    JS: Node v14 should be used along with its appropiate assertion tools (Mocha + Chai). Refer to this and this

  • bperlik Avatar

    This comment has been hidden.

  • Ina Mastabba Avatar

    Not sure if I'm correctly understanding the idea. There are two examples in the instructions. In the first, myFizz; 3 returns fizz, 5 returns buzz and 15 returns fizzBuzz because it's divisible by both. In the second, myFooBar; 2 returns foo, 4 returns bar, 6 returns foobar. I would've expected 6 to return foo , 4 to return foobar and 8 to return foobar. What am I missing?

  • tasnim Avatar

    i'm not sure what to return when the array is empty? can't see anything about that in the description.

    • tasnim Avatar

      okay, I've got it now. Consider adding in the description that the function should return n as a string if the array is empty. I only knew this by looking at the test expected result

  • andrewMacmurray Avatar

    Hey, having a bit of a problem with the JavaScript version, the tests with strings (foo bar foobbar etc) are all passing but for the n values I keep getting something like:

    didn't work for 4 - Expected: 4, instead got: 4

  • matt c Avatar

    Approved :)

  • GiacomoSorbi Avatar

    Translated; still not 100% sure the random test cases are the best (when I thought of doing this kata on my own, I have different ideas taking some coprimes together, but ok), but they are along the lines of your previous ones :)

  • bkaes Avatar

    This comment has been hidden.

    • GiacomoSorbi Avatar

      Kudos for you pointing out issues at yourself, but wouldn't all the cheating be prevented just by adding hidden random tests with a different array name?

    • bkaes Avatar

      This comment has been hidden.

    • matt c Avatar

      This comment has been hidden.

    • GiacomoSorbi Avatar

      Mh, right, though I am not sure if a user can work through it without knowing how many items are in the array, not to mention that, also in this case, if you are that good to cheat this way, then probably you don't need to cheat at all.

      Do you want me to fix it in my translations or do you think they are ok like they are now?

    • matt c Avatar

      This comment has been hidden.

    • bkaes Avatar

      the easiest being create another array along side your original one

      Yup. Going to do that. Was going to use .cloneDeep, but this solution doesn't need additional resources. Thanks.

      Do you want me to fix it in my translations or do you think they are ok like they are now?

      I have to take another look at the translations tomorrow.

      Issue marked resolved by bkaes 9 years ago
    • dfhwze Avatar

      It's the day after tomorrow now. Fixed

  • GiacomoSorbi Avatar

    This comment has been hidden.

    • bkaes Avatar

      I would test on <xxx> instead of merely <xxx>

      Changed in the tests. However, that's probably not enough, neither in the filled, nor in the complete random test.

    • dfhwze Avatar
      Suggestion marked resolved by dfhwze 11 days ago