Commit d34ff9b9 authored by Julian Helfferich's avatar Julian Helfferich

In KBlocksAILog::gotoXY(int x, int y) go to y instead of y+1

On the first line of gotoXY, the value of y was incremented. I removed
this increment and instead increased y by one in each call of gotoXY,
often by replacing y++ with ++y.
parent 330c77cb
...@@ -73,7 +73,6 @@ void close_file(int ch) ...@@ -73,7 +73,6 @@ void close_file(int ch)
void gotoXY(int x, int y) void gotoXY(int x, int y)
{ {
#ifdef DEBUG #ifdef DEBUG
y++;
char essq[100]; char essq[100];
char xstr[100]; char xstr[100];
char ystr[100]; char ystr[100];
...@@ -207,19 +206,19 @@ void println(KBlocksPiece *piece, int x, int y, bool full) ...@@ -207,19 +206,19 @@ void println(KBlocksPiece *piece, int x, int y, bool full)
{ {
if (full) { if (full) {
if (x != -1) { if (x != -1) {
gotoXY(x, y++); gotoXY(x, ++y);
} }
println(piece); println(piece);
if (x != -1) { if (x != -1) {
gotoXY(x, y++); gotoXY(x, ++y);
} }
println("STATE"); println("STATE");
if (x != -1) { if (x != -1) {
gotoXY(x, y++); gotoXY(x, ++y);
} }
print("Rotation Id :"); println(piece->getRotation()); print("Rotation Id :"); println(piece->getRotation());
if (x != -1) { if (x != -1) {
gotoXY(x, y++); gotoXY(x, ++y);
} }
print("pos: ("); print("pos: (");
print(piece->getPosX()); print(piece->getPosX());
...@@ -229,7 +228,7 @@ void println(KBlocksPiece *piece, int x, int y, bool full) ...@@ -229,7 +228,7 @@ void println(KBlocksPiece *piece, int x, int y, bool full)
println("Cells: "); println("Cells: ");
for (int i = 0; i < KBlocksPiece_CellCount; ++i) { for (int i = 0; i < KBlocksPiece_CellCount; ++i) {
if (x != -1) { if (x != -1) {
gotoXY(x, y++); gotoXY(x, ++y);
} }
print("["); print("[");
print(piece->getCellPosX(i)); print(piece->getCellPosX(i));
...@@ -251,7 +250,7 @@ void println(KBlocksField *field, int x, int y) ...@@ -251,7 +250,7 @@ void println(KBlocksField *field, int x, int y)
int h = field->getHeight(); int h = field->getHeight();
for (int j = 0; j < h; ++j) { for (int j = 0; j < h; ++j) {
if (x != -1) { if (x != -1) {
gotoXY(x, y + j); gotoXY(x, y + j + 1);
} }
print("|"); print("|");
for (int i = 0; i < w; ++i) { for (int i = 0; i < w; ++i) {
......
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