Commit 7c866dd4 authored by Michael's avatar Michael

michael.davityan:exercise_06_24v2

parent 053e7964
*
***
*****
*******
*********
*******
*****
***
*
*
***
*****
*******
*********
*******
*****
***
*
......@@ -107,8 +107,9 @@ rhombus(const int sideLength, const char drawingCharacter) {
assert((sideLength > 0) && (sideLength % 2 != 0));
const int lineLimit = (sideLength - 1) / 2;
for (int row = lineLimit; row >= -lineLimit; --row) {
for (int column = -lineLimit; column <= (lineLimit - std::abs(row)) + 1; ++column) {
if (column <= std::abs(row) - lineLimit) {
const int probelLimit = std::abs(row) - lineLimit;
for (int column = -(lineLimit - 1); column <= (lineLimit - std::abs(row)) + 1; ++column) {
if (column <= probelLimit) {
std::cout << " ";
} else {
std::cout << drawingCharacter;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment