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.
No, there is a way to make your code accept no argument.
This comment is hidden because it contains spoiler information about the solution
Approved.
Groovy Translation
.
You need to make your code work when called like
hello("bob")
or when it's just called ashello()
. You should be able to call your function with either 1 or 0 arguments. Your code only works when it is called with 1 argument.This comment is hidden because it contains spoiler information about the solution
Wow i'm stupid
No, why? Making it to work when called as
hello()
is one of requirements of this task.In the test case
test.assert_equals(hello(), "Hello, World!")
should maybe change to
test.assert_equals(hello(inp), "Hello, World!")
maybe?
100 years later, I was still staring at the monitor waiting for the kata to be approved, as cars flew by outside the window, the second technological revolution took place on Mars.
In example tests, there is a test case which looks like this:
Assert.That(Kata.Hello(), Is.EqualTo("Hello, World!"));
. Notice howHello()
is called without any argument passed in. You have to write your solution in a way which allows it. It should work for both forms:Kata.Hello(someName)
, andKata.Hello()
.This comment is hidden because it contains spoiler information about the solution
You'd have to add something to the description along the lines of "In this kata, you are expected to write a function which can take either zero or one parameters." Even then, people tend to be bad about reading the description. I think the main problem is that this kata is introducing a concept that seems to be new to newer programmers, but it's not explicitly calling out what that concept is. A lot of people solving the kata aren't even aware that what it's asking for is even possible, so it doesn't register to them as "this is something I can control". Another idea might be to have the tests catch the exception and print out a more user friendly error message that says something like "Your function doesn't work when called with no arguments." A lot of people reporting this as an issue seem to have a problem comprehending error messages. At the same time, that's a skill they should be working on, it's not really reasonable to expect kata authors to have to do that just because a lot of solvers lack a basic programming skill.
This is not exactly what I wanted to ask. I would be interested to know what to change in the kata (in the description or in examples or something) so users will see their errors as their mistake, and not as a bug with the kata.
For example what made you think that the kata is buggy? What would help you see your mistake?
Loading more items...