Ad
  • Custom User Avatar

    Very nice solution but wrong. It shouldn't pass tests for placements like this (4x0, 3x3, 2x2, 1x4):
    Assert::That(validate_battlefield(vector< vector > {
    vector {1, 0, 0, 0, 0, 1, 1, 0, 0, 0},
    vector {1, 0, 0, 0, 0, 0, 0, 0, 1, 0},
    vector {1, 0, 0, 0, 1, 1, 1, 0, 1, 0},
    vector {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    vector {0, 0, 0, 0, 0, 0, 0, 0, 1, 0},
    vector {1, 1, 1, 0, 0, 0, 0, 0, 0, 0},
    vector {0, 0, 0, 0, 0, 0, 0, 0, 1, 0},
    vector {0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
    vector {0, 0, 0, 0, 0, 0, 0, 1, 0, 0},
    vector {1, 1, 1, 0, 0, 0, 0, 0, 0, 0}
    }), Equals(false));
    There are not enought tests for this kata :)