Commit 0be40f97 authored by Michael's avatar Michael

michael.davityan:exercise_06_24v4

parent 7c866dd4
......@@ -106,10 +106,10 @@ void
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) {
const int probelLimit = std::abs(row) - lineLimit;
for (int column = -(lineLimit - 1); column <= (lineLimit - std::abs(row)) + 1; ++column) {
if (column <= probelLimit) {
for (int row = -lineLimit; row <= lineLimit; ++row) {
const int probelLimit = lineLimit - std::abs(row);
for (int column = -lineLimit; column <= probelLimit; ++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