Ad
  • Custom User Avatar

    Seems to be a CW problem: please report it at [https://github.com/Codewars/codewars.com/issues](the official github repo).

    Meanwhile, the initial code and sample tests are:

    fn get_age(age: &str) -> u32 {
      // Your code here
    }
    
    #[test]
    fn basic_tests() {
      assert_eq!(get_age("0 years old"), 0);
      assert_eq!(get_age("2 years old"), 2);
      assert_eq!(get_age("4 years old"), 4);
      assert_eq!(get_age("5 years old"), 5);
      assert_eq!(get_age("7 years old"), 7);
    }
    
  • Custom User Avatar

    Thanks again! Approved. Have a good day.

  • Custom User Avatar

    Thanks! Good job but "actual" and "expected" are not in the same position for fixed tests and random tests. Which is the good one? Random tests?

  • Custom User Avatar

    Do you feel like implementing real random tests for that kata?

  • Custom User Avatar

    No random tests for Rust: CW has not implemented the crate random for Rust because it causes problems.
    Nevertheless the Rust translator has put a few ones even if they are not completely random.

  • Custom User Avatar

    I think you could read again the description:

    Ranks are numbered from 1, not firstnames or names length.

  • Custom User Avatar

    There are no error in the tests, 729 guys passed the kata (81 with C#) as you can see at the top of the page.

  • Custom User Avatar

    It looks like Souzooka was able to make this change. Let me know if you're not seeing it. Thank you!

  • Custom User Avatar

    Hi, yes, you're right. I forgot to change the sample tests before publishing, so that's my bad.

    I think the Kata author may have to manually change the sample tests at this point.