Retired
FizzBuzz Array! (retired)
47 of 109ogryzek
Loading description...
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
No edge cases.
Code examples are confusing for a first time programmer..should be more specific.. returns [1,2,"Fizz",4,"Buzz"..etc]
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
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.
At which index point would you expect 1 to be in an array of 1 to 100?
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';
Possible duplicate of http://www.codewars.com/kata/fizzbuzz-array-custom, although that one is a little bit harder.
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.
The examples in the description show fizzBuzz as an array, not a function. They say to check for fizzBuzz[n], not fizzBuzz()[n].
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.
I'm not sure I understand; why would fizzBuzz[1] be undefined?
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.Good call,
I made some changes. Please, let me know if it makes more sense now.
Cheers,
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.fizzBuzz()[2] // returns 'Fizz'
.subjective - marking as resolved.
For what it's worth, this kata is a specific case (n = 100) of the Fizz Buzz kata (http://www.codewars.com/kata/5300901726d12b80e8000498).
Yeah, it's just a duplicate in my opinion.
It is a duplicate, however the other one seems to be Ruby only. I could modify it to use different words at different intervals.
Any suggestions?
Now that kata translations are up, the right thing to do would be to port the old kata to ruby I'm afraid...