Ad
  • Custom User Avatar

    Hi. It seems there are at least two problems currently, the reference solution throws this:

    error[E0583]: file not found for module `preloaded`
      --> src/lib.rs:44:1
       |
    44 | mod preloaded;
       | ^^^^^^^^^^^^^^
       |
       = help: to create the module `preloaded`, create file "src/preloaded.rs"
    
    error[E0432]: unresolved import `preloaded::Node`
      --> src/lib.rs:45:5
       |
    45 | use preloaded::Node;
       |     ^^^^^^^^^^^^^^^ no `Node` in `preloaded`
    
    error[E0432]: unresolved import `crate::preloaded::Arena`
      --> src/lib.rs:67:9
       |
    67 |     use crate::preloaded::Arena;
       |         ^^^^^^^^^^^^^^^^^^^^^^^ no `Arena` in `preloaded`
    
    error[E0061]: this function takes 2 arguments but 1 argument was supplied
      --> src/lib.rs:91:29
       |
    91 |             let start = rng.gen_range(0..=5000) + 5000;
       |                             ^^^^^^^^^ -------- supplied 1 argument
       |                             |
       |                             expected 2 arguments
    
    error[E0061]: this function takes 2 arguments but 1 argument was supplied
      --> src/lib.rs:92:27
       |
    92 |             let end = rng.gen_range(0..=5000) + 5000;
       |                           ^^^^^^^^^ -------- supplied 1 argument
       |                           |
       |                           expected 2 arguments
    
    error: aborting due to 5 previous errors
    
    Some errors have detailed explanations: E0061, E0432, E0583.
    For more information about an error, try `rustc --explain E0061`.
    error: could not compile `qualified-rust`.
    
    
    NOTE: Line numbers in error messages can be incorrect due to concatenation.
    

    There is a problem with preloaded (I cannot help about that, I don't know how to use it in Rust).

    The bug related to rng.gen_range can be due to a problem with language updates. You should update the kata to Rust 1.60 and make some fixes.

  • Custom User Avatar

    Using Ruby.

    #use this if you want to create your code on you computer the class of the node is in the description

    The the Node class is not in the description.

    When running "Test", I get an unexpected error:

    Response received but no data was written to STDOUT or STDERR.

    Even when I tried with a very simple solution that's wrong but should not "break":

    def loop_size(node)
      puts "Hello"
      0
    end
    
  • Custom User Avatar

    Looks like those have 100 random tests, with a smaller average size but more variability. My translation has been updated similarly.

  • Custom User Avatar

    Can you take a look at C or C++ tests then?

  • Custom User Avatar

    Added those testcases. Also, there are only two random tests, I just copied Java's tests.

  • Custom User Avatar
    • Do I read tests correctly that there are only two random tests?
    • Could you make sure that there are following fixed and sample tests:
      • no tail: 1 -> 2 -> 3 -> 4 -> 1
      • tail and tiny loop: 1 -> 2 -> 3 -> 4 -> 4
      • single node: 1 -> 1
  • Custom User Avatar

    Rust translation ready for review. Fyi, I used the arena pattern because not leaking memory in reference cycles is really hard in a non garbage collected language.

  • Custom User Avatar
  • Custom User Avatar