Ad
  • Custom User Avatar

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

  • Custom User Avatar

    This translation is old, its author has been inactive for a long time. It needs some update. I don't know if it's better to just reject it and write a new translation from scratch (I didn't review it), but in case someone is interested in it, there is a link toward a translation I have done for another similar kata that is about to be retired for being a duplicate: https://www.codewars.com/kumite/6293b1701bd1bb359ddb0c63/?sel=6293b1701bd1bb359ddb0c63

    Feel free to use it (or not).

  • Custom User Avatar
  • Default User Avatar

    I'm also relatively inexperienced, but heres my yet another two cents:

    • I find that people sometimes fork their own fork again instead of doing edits to make it more clear that something has changed.

    • I find that some of the Katas that are "not so recent" don't get the translations approved instantly just because the creator doesn't log on daily/weekly/monthly anymore. So don't worry if it takes a while to get your translations out there.

    • You can create a 50/50 in Rust with rng.gen::<bool>() without a bernoulli distribution

    • If length and width are never negative, why not have them as u64 or u32

  • Custom User Avatar

    Thank you I'm new to translating Katas. Suggestions applied.

  • Default User Avatar

    I'm a noob but here's my two cents:

    warning: variable does not need to be mutable
      --> src/lib.rs:36:17
       |
    36 |             let mut a = rng.sample(num_distr);
       |                 ----^
       |                 |
       |                 help: remove this `mut`
       |
       = note: `#[warn(unused_mut)]` on by default
    
    warning: variable does not need to be mutable
      --> src/lib.rs:37:17
       |
    37 |             let mut b = if rng.sample(bool_distr) {
       |                 ----^
       |                 |
       |                 help: remove this `mut`
    
    warning: 2 warnings emitted
    

    ^
    tests generate these warnings

    also function called solution is not in the tests module. This means that its possible to type this:

    fn area_or_perimeter(l: i64, w: i64) -> i64 {
        solution(l, w)
    }
    

    and win the kata. Can be fixed by moving solution to tests module.

  • Custom User Avatar
  • Default User Avatar

    Thanks. Approved.