Ad
  • Default User Avatar

    I wish they would update the compiler, I got burnt on writing a Fortran Queue that makes use of allocatable data types. I wrote it in Visual Studio, but when I copied and pasted the code it the CodeWars compiler bounced back saying it did not support allocatabled data types.

    That is:

    TYPE QUEUE
    INTEGER:: I
    TYPE(QUEUE), ALLOCATABLE:: NXT
    END TYPE

    Resulted in the compiler complaining:

    TYPE(QUEUE), ALLOCATABLE:: NXT

    is not allowed when it is part of the Fortran 2008 Standard

  • Default User Avatar

    I think my solution correctly gives the "brute-force functions" requested in Task 1. Now I've seen other solutions the 2nd task is superfluous.

  • Custom User Avatar

    But what happened to n being "relatively small"?

    Seriously. The description makes it seem like the algorithmic complexity isn't a factor. I would have approached this problem completely differently if I'd known the "relatively small" n would timeout. A bit frustrating to be honest, especially considering how many comments are pointing this out.

  • Default User Avatar

    Thanks!

  • Default User Avatar

    A nice little problem that was fun finding the optimal code!
    I'd just say that the numerical examples are necessary to sort out e.g. when c0 is taken.

  • Default User Avatar
  • Default User Avatar

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

  • Custom User Avatar

    @Phil157 If you are stuck with the Fortran version of this Kata, feel free to post your code here and mark it as a spoiler so I can review it and perhaps provide some feedback, cheers :)

  • Custom User Avatar

    I think this output issue is due to the Fortran CW-2 testing framework itself. I'll look into improving its output by replacing special characters (such as newlines) with their escape sequence equivalents (e.g. \n) in my spare time.

  • Default User Avatar

    I had a random test (data = 5864, 8410, 1193, 1.5) fail with a value just below x.5000 (in both my Fortran & Excel) being rounded UP to x + 1, so I added a halfpenny!

  • Default User Avatar

    I am asking @donaldsebleung to see your posts (he is the Fortran translator).

  • Default User Avatar

    Outputs are different through languages.
    "(3(A, I0), A)" is good practice.

  • Default User Avatar

    In your instructions the example output, ["M: f", "B: b", "C: c"], should not have any " or , !

    I see the other 2 solutions write results with format "(A, I0, A, I0, A, I0, A)", is "(3(A, I0), A)" not good practice?

  • Default User Avatar

    Hi, I'm still stuck like my last post - sorry to send it on a weekend, I realised almost immediately after hitting "Post".

  • Default User Avatar

    Try a different zoom level - I've just posted on a very similar problem.

  • Loading more items...