Retired

FizzBuzz Array! (retired)

47 of 109ogryzek
Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • dominathan Avatar

    No edge cases.

    Code examples are confusing for a first time programmer..should be more specific.. returns [1,2,"Fizz",4,"Buzz"..etc]

  • betasve Avatar

    tests were not very clearly defind. you have a function yet it's supposed to respond to the_function[element_num] which is an array behavior

  • mimshwright Avatar

    I think it's confusing that fizzBuzz[0] == 1. I think use the 0 based index. Please add a couple of texts to the example tests.

    • ogryzek Avatar

      At which index point would you expect 1 to be in an array of 1 to 100?

    • mimshwright Avatar

      I think it would be a little easier to read if the array was actually from 0 to 100. That way fizzBuzz[1] == 1, fizzBuzz[3] == 'Fizz' etc more like a function call.

      Another minor detail, in the description, it shows the following as an example. fizzBuzz[2] // returns 'Fizz'

      This is somewhat confusing since the name of the function to write is also fizzBuzz. So it might be more clear to either define the results first in the example or to name the function something different.

      var results = fizzBuzz(); resutls[2] // retuns 'Fizz'

      or

      var fizzBuzz = generateFizzBuzzArray(); fizzBuzz[2] = 'Fizz';

  • bkaes Avatar

    Possible duplicate of http://www.codewars.com/kata/fizzbuzz-array-custom, although that one is a little bit harder.

    • ogryzek Avatar

      The one linked takes arguments for the terms and numbers. Personally, I feel they are different enough, however if others do not, then we could either change the words used from "Fizz", "Buzz" to "Snap", "PoP" or something like that.

      Issue marked resolved by ogryzek 11 years ago
  • Tomu-san Avatar

    The examples in the description show fizzBuzz as an array, not a function. They say to check for fizzBuzz[n], not fizzBuzz()[n].

  • notian Avatar

    The example in the description is not similar to what the test cases would be, nor are there any pre-submission test cases.

    fizzBuzz[1] would be undefined, fizzBuzz()[x] or fizzBuzz = fizzBuzz(); would work, but that's not made obvious in the example.

  • wthit56 Avatar

    Pretty confusing at first to figure out what you're expecting. You could say somewhere that the function should return an array which includes... to make it clearer.

    • ogryzek Avatar

      Good call,

      I made some changes. Please, let me know if it makes more sense now.

      Cheers,

    • wthit56 Avatar

      Yup; that's a bit better.

      A few more possible tweaks:

      • then it adds --is an odd phrase. Just say that "the value should be", instead.
      • The "example" given isn't really how such code would work. It suggests that the coder just needs to write into an existing array, and the tests will look at that array. But in reality, the function will be called to get the array, and then test will be run against that. So the code would look more like: fizzBuzz()[2] // returns 'Fizz'.
    • ogryzek Avatar

      subjective - marking as resolved.

      Suggestion marked resolved by ogryzek 11 years ago
  • mlabrum Avatar

    For what it's worth, this kata is a specific case (n = 100) of the Fizz Buzz kata (http://www.codewars.com/kata/5300901726d12b80e8000498).