Ad
  • Custom User Avatar

    If only one could look into the future like this to understand if tommorow's prices would rise... IMHO the real final value should be the current value of the shares (i.e. last price) if you're still holding them.

  • Custom User Avatar

    fixed

  • Custom User Avatar

    Tests cannot run in C. (edit: Attempt ran without these errors and failed as expected but Test delivers these errors)

    fixture.c:41:33: error: too few arguments to function call, expected 3, have 2
        assert_approx_eq(actual, 1.0);
        ~~~~~~~~~~~~~~~~            ^
    fixture.c:17:1: note: 'assert_approx_eq' declared here
    static void assert_approx_eq(const double prices[], size_t n_prices, double expected)
    ^
    fixture.c:47:33: error: too few arguments to function call, expected 3, have 2
        assert_approx_eq(actual, 1.5);
        ~~~~~~~~~~~~~~~~            ^
    fixture.c:17:1: note: 'assert_approx_eq' declared here
    static void assert_approx_eq(const double prices[], size_t n_prices, double expected)
    ^
    fixture.c:53:33: error: too few arguments to function call, expected 3, have 2
        assert_approx_eq(actual, 1.5);
        ~~~~~~~~~~~~~~~~            ^
    fixture.c:17:1: note: 'assert_approx_eq' declared here
    static void assert_approx_eq(const double prices[], size_t n_prices, double expected)
    ^
    3 errors generated.
    
  • Custom User Avatar

    Despitee terrible efficiency, funny enough its still O(n). :)
    O(25n)==O(n)

  • Custom User Avatar

    done

  • Custom User Avatar

    My rust translation shows both. You get the u8 bytes and the same data decoded as a Latin1 string.

  • Custom User Avatar

    (I meant to mark this suggestion as resolved, hereby).

  • Custom User Avatar

    I've now published my translation, see the new suggestion I made.

  • Custom User Avatar

    I've created a new translation; the tests in the translation were partially based on yours but I extended them (adding the advanced and random tests, as well as several corrections made to the general kata test suites). I also re-used your starting template.

    My translation features an optimising BF interpreter that matches and exceeds the optimisations made in the other kata translations here.

  • Custom User Avatar

    I might pick this up at some point. I already started on a Rust version, your version could be helpful in accellerating the process.

  • Custom User Avatar

    I've fixed this across all translations, by escaping the quote:

    end
    msg " That\'s end"
    
  • Custom User Avatar

    Got the answer, kept for posterity to clarify the rule on defender bonus calculation:
    "M attack. R Power 4. R wins
    Go to the trench
    P has power 3 of the L team. It gets the trench defense bonus 6 so it wins. 2 remains after the successful defense.
    2 points is less than the original 3 so it keeps 2 power
    It overpowers first s and losses 1 power point keeping 1.
    Overcomes the second s with a draw and retreats. The next s wins its position"

  • Custom User Avatar

    Can someone explain why with this input:

    m     
    -|pzzz
    

    the expected output is R|LLLR (not R|LLLL)?

  • Custom User Avatar

    Haskell fork that updates the random test generation to avoid generating numbers with exponents.

  • Custom User Avatar

    Sorry for offtop, but what software you used to generate this image? I was looking for something like that for a while

  • Loading more items...