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.
First, you have to complete the kata in any of the available languages. Then, you can click on the translations tab near the top of the page, and click on the
translate
button. Then, you have to program the kata in your language of choice and publish the translation. Documentation on the testing libraries and methodologies is not super great, I suggest looking at translations done for other kata in your language to get a better grasp on it. Notably, one of the mods has a small collection of kata that exemplify best practices for programming kata available in most (if not all) available languages on codewars. You can find that hereAfter that, it's a good idea to leave a new comment here in the discourse with the "suggestion" tag with a link to your translation. Either the kata's author or another user will have to approve your translation before it can go live.
I suggest reading the translation authoring guidelines, and it wouldn't be a bad idea to read all of the docs in the authoring section (even though not all of it will apply to translations). It's also a good idea to join the codewars discord so you can post a link to your completed translation in the "reviewing" channel, and get help in the "help-translate" channel. The discord will get you a lot more visibility on your translation.
these series of problems are so useful but unfortunately no cpp and many languages how can i contribute?
my codes instantly worked after moving the global variables into the class under public:
As far as I see, every tests gets its own instance of
SnakesLadders
, so there should be no need to reset anything. It is difficult to say what is wrong with your solution without seeing your code, but maybe you are using some global or static data instead of instance fields?my code written in C++
the stored player positions is not reset after the example tests and is carried on to the random tests, and that is causing errors
since the game hasnt ended in example tests, i can't reset the game before the random tests begin
anyone has any idea on how to make this work
Logical I don't understand how is the right solution 5, I think it' 4.
For example, if your size is
2
and you encounter a fish of size3
, you must wait to be of at least size3
to eat it (if you ever reach size3
). Your solution don't take size into consideration.Your solution re-eats the same fish for each level.
Can anyone explain me:How we get for "111111111111111111112222222222" the length of the fish is 5?
I've found it
1111 (2) 2222 (3) 111111111111 (4) 1111222222 (5)
This comment is hidden because it contains spoiler information about the solution
I tried OP's code and it does not handle cases where the fish grows to sizes beyond what is mentionned in the description. the confusion about the input is probably due to the tests suite logging the input to the console instead of making it part of the assertion message. i've fixed that and enabled Node 18+. there is already a suggestion about the lack of clarity of the description (it's not clear that we have to deduce a formula from the table)
question answered by PetitLu117
fixed and added better assertion messages
In the description there is a table that describes how a fish grows. But the table ends with fish size 7, so I assumed that growth is limited.
Only the other fishes from the shoal ranges from 0 to 9. You (the growing fish) are not limited in size.
I have not solved this myself so I can only speculate. I suspect that the input fish are limited to single digit ranges but that your own size can grow as large as the food eaten allows. Perhaps there is a pattern with regards to how much you eat and how big you get? Maybe we should consider ourselves a special fish that can gorow past the limits of all other fish? I realize that I am answering with more questions to a question, sorry about that.
Loading more items...