Ad
  • Custom User Avatar

    You should provide more details on why adding String in loop is a bad practice (performance issue) and a solution (StringBuilder). I don't remember this kata but a Regex compiled in a loop plus a Scanner are overkill and even worse than a String adding. A better way is to use Pattern/Matcher and parse... function from Double and Integer.

    In any case this code is not a 'Best Practices', but a quick-and-dirty simple solution.

  • Custom User Avatar

    No, so I guess there is a bug (at least)

  • Custom User Avatar

    Ok, null is expected when a function is added.

  • Custom User Avatar

    I'm stuck with functions(InterpreterTest) test case.

    x = 23
    y = 25
    z = 0
    fn one => 1
    input: 'fn one => 1' expected: but was:<0.0>
    

    My code return 0.0 when a function is added (I didn't see in description what it should return). fn one => 1 looks fine for me so I return 0.0 but I guess an Exception is expected.
    conflicts test case pass and there is almost the same situation E.g : fn f => 1

    Can someone tell me why ? or what is expected ?

  • Custom User Avatar

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

  • Custom User Avatar

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