Ad
  • Default User Avatar

    great problem!
    Would love to see a follow up problem to this one maybe something like getting assembly (or some kind of bytecode) as input and the goal is to produce a readable expression like:
    input:
    AR 0 SW IM 2 MU SW IM 1 SU
    output:
    [a] 1-a*2
    (this wouldn't be a 1kyu problem but it would be fun :) )

  • Default User Avatar
  • Default User Avatar

    I feel like it should be mentioned in the problem Statement that not only you have to check if the numbers lign up, but also if the string is the exact lenght, contains ivalid characters etc.

  • Default User Avatar

    Am I being stupid here?

    I think I've solved this, but I'm getting the following test failure in PHP:

    prog(4,0,0) == 3
    Failed asserting that 3 matches expected 1.
    Expected: 1
    Actual  : 3
    

    It should equal 3, not 1, right?

  • Default User Avatar

    JavaScript, CoffeScript: no random tests

  • Default User Avatar
  • Custom User Avatar

    Missing fixed tests for strings using " as placeholders in (present in Python && PHP)

    • JS

    • Ruby

  • Custom User Avatar

    Ruby:

    • NO random tests

    • 3.0 should be enabled

  • Custom User Avatar

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

  • Default User Avatar

    Hey all! I made a Julia translation. Would appreciate it if any reviewers who are fellow Julia fans could take a look.

  • Custom User Avatar

    The Rust translation has a laundry list of issues, to be frank. Here are some:

    • Ast enum should be preloaded/filled out, including derive(Debug). The tests expect a very specific type, so why make the user fill it out?
    • Why are BinOp and UnOp stringified? They should have their own enums. There are 0 strings in actual AST, after all.
    • Why is the tokenizer provided? Why is it tested?
    • Tokenizer being tested means I can't adapt it to my own preferences, e.g. to use something without silly stringification
    • Stringly types means I have to make unnecessary allocations all over the place
    • "Operator associativity" test can be passed by returning an empty vector
    • No random tests!!
    • Assertion messages are useless. Debugging is a pain.
    • Initial solution should instantly compile without user action
    • Uses very old syntax that no longer compiles under current Rust version/edition
    • Why is there a "compiler creation" test? Either code compiles or it doesn't. The test does literally nothing.

    I was hoping the Rust translation was in better shape than the Python version. Too bad.

  • Custom User Avatar

    Dart issues:

    • "actual" and "expected" values are swapped
    • print() statements aren't shown at all (is it somehow disabled?)
    • The description shows a, b and n as methods, but they are defined as getters (?)
  • Custom User Avatar

    In the Rust version, the AST format description has:

    Ast::BinOp("+".to_string(), Box::new(a), Box::new(b) }
    Ast::BinOp("-".to_string(), Box::new(a), Box::new(b) }
    Ast::BinOp("*".to_string(), Box::new(a), Box::new(b) }
    Ast::BinOp("/".to_string(), Box::new(a), Box::new(b) }
    

    These open the variant construction call with ( and close it with }.
    I'm assuming the translator meant to close it with ), because the fields are not labeled like a struct variant would be.

  • Default User Avatar

    C translation (author inactive)

  • Default User Avatar

    F# translation

    (Note: Original author appears to be inactive)

  • Loading more items...