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.
chatgpt (not to be offensive)
spoiler flag please! :/
This comment is hidden because it contains spoiler information about the solution
Fixed.
I like this because it more likely "functional programming". Nesting maps causes brain overload (as SonarCube says).
Still lots of things to point at in the kata test cases:
Test.expect
is wrong - if you want to show a specific success message after a kata, you need to keep track of the number of successful tests yourself, then use aTest.describe
at the end inside anif
block.Really good effort in creating a backstory. However, the actual task gets a bit lost in all the text! This could be made a bit clearer. I would recommend either editing your text or using HTML to tidy up your description a bit.
Interesting background story and a good amount of fixed tests for an
8 kyu
Kata but may I suggest that you add a few random test cases? Here's a link that you may find useful regarding how to write them.Thanks dangerdak ! No, I hadn't seen that guide before. Thanks for sharing it will be very useful in doing my next kata xD . It explains the testing well.
Nice kata. Have you seen this guide for writing your own kata? It's really useful, particularly for tips on writing tests. I think it's really handy being able to see which inputs caused a test to fail, and you could make some random tests too.
Thanks for the heads-up, will try your new Kata soon :D
Hi zruF,
Although the coding required here is less complicated, part of this test was testing that the user gets used to understanding the task. I tried to achieve this by providing a large and detailed description . I purposley missed out the } as I wanted the user to input it, but to make it more user freindly following your feedback I have now added it and written a ///only edit code above this line section. I look forward to building more complicated kata ! Thanks again ! :)
Hi bowssy88,
good job!
Your test seem to be fine now! For this kind of kata, they are ok. But for more complicated kata with a more flexible output, I'd suggest you to build some random test cases. It prevents user from cheating ;)
You also forgot a "}" in your preloaded solution.
It's good to learn from such mistakes. The next katas will be better and better ;)
Hi zruF,
Firstly thank you so much for your feedback, I really appreciate it !
Based on that, I learnt something new today xD. I have added 11 tests. These tests will check the return value of the function and the resulting output. I have also improved the description on how to calculate the estimated years by specifying:
'In order to calculate the number of years it will take to build the Great Pyramid, you must add two paremeters, (strength) + (skill).'
I do hope this resolves the issue and let me know if there is anything else you suggest to improve it ! Many thanks :)
You need to work on your tests :)
You don't check the return value of the function. Also add some random and example tests.
And you need a better description how to calculate the estimated years.
Loading more items...