6 kyu

Counting ASCII Art Squares

63 of 99mnemonix666
Description
Loading description...
Geometry
Algorithms
Puzzles
  • Please sign in or sign up to leave a comment.
  • ahmet_popaj Avatar

    Nice one of the ASCII art series, funny to practice objects detection with.

  • dfhwze Avatar

    Rust solution setup uses a template:

    // Return the two oldest/oldest ages within the vector of ages passed in.
    // it should return the two ages as a sorted vector, youngest age first
    fn two_oldest_ages(mut ages: Vec<i32>) -> Vec<i32> {
      // Code logic here
    }
    
  • seleemdz Avatar

    Nice Kata!

  • FArekkusu Avatar

    + is used to represent corners and intersections

    +---+
    |   |
    |   |
    +--+|+--+
    +--++|  |
    +--+-+--+
       | |
       | |
       +-+
    

    Apparently, "-" and "|" can appear at intersections too, and nothing's told about how such cases should be handled.

  • FArekkusu Avatar

    C++ version generates warnings.

  • user5286943 Avatar

    Language: C++

    random_medium

    ```

                +--------+
                |        |
                |        |
                |        |
                |        |
    

    +------++---+| | | || || | | || || | | || || | | || +++--------+------+-+ | || || +-----------+-+-+ | || || | | | | +------+| || | | | | | || | | | | +----+-+++ | | | | | ||| | | | | | ||| | | | | | ||| | | | | +--+------+|| | | | | | | ||| | | | | | | ||| | | | | +-+--+------+++----++ | | | | | | ||| || | | | | | | ||| || | | | | | | ||| || | | | | | | ||+----++---+------+-++| | | | || ++---+------+--++ | | | |+------+---+------+ | | +--+------+ | | | +----+------+-------+ | | | | | | | | | | | | +---------+ ```

    What should be the expected square for this?

  • sigod Avatar
    // Return the two oldest/oldest ages within the vector of ages passed in.
    // it should return the two ages as a sorted vector, youngest age first
    fn two_oldest_ages(mut ages: Vec<i32>) -> Vec<i32> {
      // Code logic here
    }
    
    #[test]
    fn test_add() {
        assert_eq!(add(1, 2), 3);
    }
    

    I believe there's something wrong Rust translation of this kata...

  • user5286943 Avatar

    This comment has been hidden.

  • user5286943 Avatar

    hello,

    I used C++ language. My solution works fine for Sample. When I attempt to submit, it says 'Time: 2279ms Passed: 6 Failed: 0 Exit Code: 139'!!

  • smokinhiro Avatar

    Me, too, when I try to submit my solution I get the same error saying "main.cpp:433:20: error: use of undeclared identifier 'is_valid_horizontal'...", etc. It's a nicely challenging kata which I'm enjoying though :)

  • kbenj Avatar

    ISSUE: unexepected compile error in C++

    Hi! When I try to submit (not "run tests") the final version of my solution, I get unexpected compile errors which have nothing to do with my code (see below). Functions is_valid_horizontal and is_valid_vertical are not in my code.

    [Note: this is a really good kata, I've enjoyed working on it.]

    kbenj


    STDERR: main.cpp:345:20: error: use of undeclared identifier 'is_valid_horizontal' is_valid_horizontal(lines[a->y], a->x, b->x) && ^ main.cpp:346:20: error: use of undeclared identifier 'is_valid_horizontal' is_valid_horizontal(lines[b->y], a->x, b->x) && ^ main.cpp:347:20: error: use of undeclared identifier 'is_valid_vertical' is_valid_vertical(lines, a->x, a->y, b->y) && ^ main.cpp:348:20: error: use of undeclared identifier 'is_valid_vertical' is_valid_vertical(lines, b->x, a->y, b->y)) ^ 4 errors generated.


  • Jomopipi Avatar

    nice kata

  • Blind4Basics Avatar

    needs random tests (but that won't be easy to implement)