diff --git a/fh.fd.ci.client/src/main/java/de/fd/fh/Figure.java b/fh.fd.ci.client/src/main/java/de/fd/fh/Figure.java index 87f0b1a..9aabba5 100644 --- a/fh.fd.ci.client/src/main/java/de/fd/fh/Figure.java +++ b/fh.fd.ci.client/src/main/java/de/fd/fh/Figure.java @@ -21,7 +21,7 @@ public class Figure return false; } - if (src / 8 - dst / 8 > 0 && src % 8 - dst % 8 < 0) // diagonal nach rechts oben + if (src / fieldLength - dst / fieldLength > 0 && src % fieldLength - dst % fieldLength < 0) // diagonal nach rechts oben { return false; } diff --git a/fh.fd.ci.client/src/test/java/de/fd/fh/FigureTest.java b/fh.fd.ci.client/src/test/java/de/fd/fh/FigureTest.java index b21b68b..4201262 100644 --- a/fh.fd.ci.client/src/test/java/de/fd/fh/FigureTest.java +++ b/fh.fd.ci.client/src/test/java/de/fd/fh/FigureTest.java @@ -60,6 +60,6 @@ class FigureTest void whiteRookInvalidMoveRightUp() // diagonal nach rechts oben { Figure f = new Figure(); - assertFalse(f.moveAllowed(36, 29, new int[8 * 8])); + assertFalse(f.moveAllowed(Figure.fieldLength * 4 + 4, Figure.fieldLength * 3 + 5, new int[Figure.fieldLength * Figure.fieldLength])); } } \ No newline at end of file