Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This kata is misleading in yet another way. The way that I usually approach these is to run the examples, and if the examples pass, then I submit an "attempt". But in this case, "Run examples" apparently always says that your code fails. This is my output:
Time: 417ms Passed: 0 Failed: 1
Since I couldn't figure out what was wrong with my code, I submitted anyway, and it passed.
But the instructions say that under certain circumstances, the value of the area should be the string "Fizz" or "Buzz" or "FizzBuzz". Those are not numbers from 1 to 100. My question about default values is that the instructions don't say what the arguments are used for. They only say what the function is supposed to do if there are no arguments.
Here's what I think you're asking for:
fizzBuzzCustom(stringOne, stringTwo, numOne, numTwo) returns the result of starting with the array [1, 2, ..., 100], and replacing each number in the array by stringOne if it is divisible by numOne (but not divisible by numTwo), replacing it by stringTwo if it is divisible by numTwo (but not numOne), and replacing it by the concatenation of stringOne and stringTwo if it's divisible by both. If a number in the array is divisible by neither numOne nor numTwo, leave it unchanged.
If fewer than 4 arguments are supplied, use the default values of "Fizz" for stringOne, "Buzz" for stringTWo, 3 for numOne and 5 for numTwo.
I found the instructions for this challenge to be completely confusing. It wasn't at all clear what was being asked for. For example:
"Create a method/function that returns an array of numbers from 1 to 100."
Does that mean an array of length 100? Or does it mean an array whose elements are numbers from 1 to 100?
For another example, the instructions say:
"If no arguments are passed, the value at the index of the array for the number should be 'Fizz' if it is divisible by 3, 'Buzz' if divisible by 5, 'FizzBuzz' if it divisible by both 3 and 5, or the number if it is not divisible by 3 or 5."
What does "the index of the array for the number" mean? I assume it just means that if x is the array, then x[i] should be equal to 'Fizz' if i is divisible by 3, etc. But the examples don't show that. It seems to show that if i+1 is divisible by 3, ...
For another example, the instructions don't actually say what is supposed to be done with the arguments. The instructions say: "If no arguments are passed, ...", but it doesn't say what to do with the arguments if they are passed. The instructions say "The first and second arguments are strings, which should be 'Fizz' and 'Buzz' by default. The third and fourth arguments are integers and and should be 3 and 5 by default." But there is no indication of how to use the arguments, so I'm not sure what it means to use defaults for the values.
Finally, the test that is performed when you click "Run Examples" doesn't actually do anything. So are we supposed to write our own test? I have no idea what the program is supposed to do, so how could I possibly write a test to see if it does it correctly?
Is this challenge supposed to be preparation for a job as a programmer, when you often have no idea what the customer actually wants?
Hi, I'm sorry for overreacting. It seems that it was a temporary problem.
The symptom was that when I went to "View Profile", then selected "Kata", then selected this challenge, "Musical Pitch Classes", then selected "Solutions", then selected "My Solutions", the result was a message saying "No Soluions Submitted". Which was not true.
The same thing happened with several other challenges, including "Create Phone Number" and "Find Count of Most Frequent Item in an Array".
All of these challenges now show the solutions I submitted. Is there a delay between clicking "Submit Final" and the solution appearing in my profile?
This comment is hidden because it contains spoiler information about the solution