Ad
  • Default User Avatar

    this is really ugly and doesn't really work in all cases

  • Default User Avatar

    In this, Fooby check all the cells of the field from left to right, for each row top to bottom. If Fooby find a ship then Fooby check its direction then length and for if any illegal ships are parked. Fooby remove the ship to prevent it from interfering with the continuation of ship scan. In the end if the correct number of each ship is present, the function returns true. Fooby did it!

  • Default User Avatar

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

  • Default User Avatar
  • Default User Avatar

    When starting solution in C++ is tested by sample tests, it says :

    Time: 1230ms Errors: 1 Exit Code: 1
    STDERR:
    main.cpp:16:9: error: C++ requires a type specifier for all declarations
    Assert::That(properFractions(1), Equals(0));
    ^
    main.cpp:17:9: error: C++ requires a type specifier for all declarations
    Assert::That(properFractions(2), Equals(1));
    ^
    main.cpp:18:9: error: C++ requires a type specifier for all declarations
    Assert::That(properFractions(5), Equals(4));
    ^
    main.cpp:19:9: error: C++ requires a type specifier for all declarations
    Assert::That(properFractions(15), Equals(8));
    ^
    main.cpp:20:9: error: C++ requires a type specifier for all declarations
    Assert::That(properFractions(25), Equals(20));
    ^
    5 errors generated.

  • Default User Avatar

    Thanks for the suggestion.
    I have reworked the description to include that more prominently.

  • Default User Avatar

    siebenschlaefer,
    They say you learn the most when you are wrong, and I have learned much today.

    I am happy to report that thanks to your help, I have fixed the description to say "today's date" is March 24, 2437. That was a major error that you pointed out.
    The TimeTravel class is no longer included.
    Random tests will no longer generate dates between and inclusive of 1752-09-03 to 1752-09-13.

  • Default User Avatar

    Thank you for your input. You would be entirely correct if this kata were intended to test based on only the Gregorian calendar. However, please note the following quote in the description:

    "To further complicate matters further, a date correction was made when switching from the Julian to calendar to the current (Gregorian) calendar. It was declared that Sep 2, 1752 was proceeded immediately by September 14, 1752, entirely omitting September 3-13 in 1752. Also, prior to that date leap years were on every year divisible by 4, without the exception of years divisible by 100. 1752 was a leap year and so was 1700 and the year 0."

    For instance, please observe that 1700 is a leap year here https://www.timeanddate.com/calendar/?year=1700&country=1
    Also please observe that much of September 1752 is missing here: https://www.timeanddate.com/calendar/?year=1752&country=1

    Thanks for spending your time trying out this new kata and I invite you you retry the kata with the additional challenge of the specified calendar change. Thank you.

  • Default User Avatar

    Thank you so much for taking the time to reporting these issues! I am surprised I overlooked some of this. I will repair the kata as soon as I can tomorrow.

  • Default User Avatar

    This kata says my 2 tries fail the for-loop detection:
    Try 1: No for loops, 1 while loop
    Try 2: No for loops, used goto label
    While this is ok, there needs to be a clear description of what the kata permits or does not permit in the solution.

  • Default User Avatar

    Wow this was difficult. I tried it semi-brute force and the optimization took hours.

  • Default User Avatar

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

  • Default User Avatar

    There appear to still be issues with the testing code. My posted solution should not work yet it is accepted. At the same time my current code should(?) work but doesn't.

  • Default User Avatar

    Wow this is long