Skip to content
Snippets Groups Projects
Commit a6f3632b authored by Manuel Bucher's avatar Manuel Bucher
Browse files

fixed Rechteckausgabe

parent 7bc983c1
Branches
No related merge requests found
...@@ -124,21 +124,21 @@ bool list_rectangle(List *this) { ...@@ -124,21 +124,21 @@ bool list_rectangle(List *this) {
* Voraussetzung: notwendiges Kriterium erfuellt & es handelt sich um ein Rechteck * Voraussetzung: notwendiges Kriterium erfuellt & es handelt sich um ein Rechteck
*/ */
void list_print_rectangle(List *this) { void list_print_rectangle(List *this) {
for (uint32_t y = this->min.y;; y++) { for (uint32_t x = this->min.x;; x++) {
for (uint32_t x = this->min.x;; x+=2) { for (uint32_t y = this->min.y;; y+=2) {
if (x == this->max.x - 1) { if (y == this->max.y) {
if ((y - this->min.y) % 2 == 0) { if ((x - this->min.x) % 2 == 0) {
// vertikaler Stein // vertikaler Stein
printf("%u %u;%u %u\n", x, y, x, y+1); printf("%u %u;%u %u\n", x, y, x+1, y);
} }
break; break;
} }
printf("%u %u;%u %u\n", x, y, x+1, y); printf("%u %u;%u %u\n", x, y, x, y+1);
if (x == this->max.x) { if (y == this->max.y-1) {
break; break; // ende des Zeile erreicht
} }
} }
if(y == this->max.y) { if(x == this->max.x) {
break; break;
} }
} }
......
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