Ad
  • Custom User Avatar

    my codes instantly worked after moving the global variables into the class under public:

  • Custom User Avatar

    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?

  • Custom User Avatar

    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

  • Custom User Avatar

    Logical I don't understand how is the right solution 5, I think it' 4.

  • Custom User Avatar
    1. You can only eat fish the same size or less than yourself.

    For example, if your size is 2 and you encounter a fish of size 3, you must wait to be of at least size 3 to eat it (if you ever reach size 3). Your solution don't take size into consideration.

    7 You can and only eat each fish once.

    Your solution re-eats the same fish for each level.

  • Custom User Avatar

    Can anyone explain me:How we get for "111111111111111111112222222222" the length of the fish is 5?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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)

  • Custom User Avatar

    question answered by PetitLu117

  • Custom User Avatar

    fixed and added better assertion messages

  • Custom User Avatar

    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.

  • Custom User Avatar

    Only the other fishes from the shoal ranges from 0 to 9. You (the growing fish) are not limited in size.

  • Custom User Avatar

    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.

  • Custom User Avatar

    C#: How can the expected fish size be 13 if the fish size ranges from 0-9?

    Testsing for '2377850450199216028943563875738515541737295533926856280293197429940060020'
    
    Test Failed
      Assert.That(game1.fish(fs1), Is.EqualTo(result))
      Expected: 13
      But was:  7
    

    Can anybody help me?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Loading more items...