summaryrefslogtreecommitdiffstats
path: root/core/test/ch/asynk/tankontank
diff options
context:
space:
mode:
Diffstat (limited to 'core/test/ch/asynk/tankontank')
-rw-r--r--core/test/ch/asynk/tankontank/BoardUtils.java197
-rw-r--r--core/test/ch/asynk/tankontank/Helpers.java144
-rw-r--r--core/test/ch/asynk/tankontank/LineOfSightTest.java1421
3 files changed, 0 insertions, 1762 deletions
diff --git a/core/test/ch/asynk/tankontank/BoardUtils.java b/core/test/ch/asynk/tankontank/BoardUtils.java
deleted file mode 100644
index a0b5a1b..0000000
--- a/core/test/ch/asynk/tankontank/BoardUtils.java
+++ /dev/null
@@ -1,197 +0,0 @@
-package ch.asynk.rustanddust;
-
-import java.util.List;
-import java.util.ArrayList;
-import java.util.HashSet;
-
-import org.junit.Test;
-import org.junit.Before;
-
-import ch.asynk.rustanddust.engine.Tile;
-import ch.asynk.rustanddust.engine.Path;
-
-import static org.junit.Assert.assertTrue;
-
-public class BoardUtils
-{
- private Helpers.FakeBoard b;
- private Helpers.FakeSearchBoard sb;
-
- @Before
- public void initialize()
- {
- int cols = 10;
- int rows = 9;
- int mvt = 3;
- b = new Helpers.FakeBoard(cols, rows, 3);
- sb = new Helpers.FakeSearchBoard(b, cols, rows);
- }
-
- private void assertTile(Tile t, int col, int row)
- {
- assertTrue(t.getCol() == col);
- assertTrue(t.getRow() == row);
- }
-
- @Test
- public void testPaths()
- {
- int n = b.buildPathBuilder(2, 2, 4, 3);
-
- assertTrue(b.pathBuilder.distance == 2);
- assertTrue(n == 8);
-
- for(int p = 0; p < n; p++) {
-
- Path path = b.pathBuilder.getPath(p);
- int z = path.tiles.size();
- assertTrue(path.cost == (z + 1));
-
- Tile t;
- int i = 0;
- if (z == 1) {
- t = path.tiles.get(i);
- assertTrue(t.getCol() == 3);
- assertTrue((t.getRow() == 2) || (t.getRow() == 3));;
- } else if (z == 2) {
- t = path.tiles.get(i);
- if (t.getCol() == 2) {
- i += 1;
- if (t.getRow() == 1) {
- t = path.tiles.get(i);
- assertTile(t, 3, 2);
- } else {
- assert(t.getRow()== 3);
- t = path.tiles.get(i);
- assertTile(t, 3, 3);
- }
- } else if (t.getCol() == 3) {
- i += 1;
- if (t.getRow() == 2) {
- t = path.tiles.get(i);
- if (t.getCol() == 3)
- assert(t.getRow()== 3);
- else {
- assertTile(t, 4, 2);
- }
- } else {
- assert(t.getRow() == 3);
- t = path.tiles.get(i);
- if (t.getCol() == 3)
- assert(t.getRow() == 2);
- else {
- assertTile(t, 4, 4);
- }
- }
- } else {
- assertTrue(false);
- }
- } else {
- assertTrue(false);
- }
- }
- }
-
- @Test
- public void testPathSet()
- {
- int n = b.buildPathBuilder(2, 2, 3, 3);
- assertTrue(n == 1);
-
- n = b.buildPathBuilder(2, 2, 4, 3);
- assertTrue(n == 8);
-
- n = b.togglePoint(3, 3);
- assertTrue(n == 1);
-
- n = b.buildPathBuilder(2, 2, 5, 3);
- assertTrue(n == 3);
-
- n = b.togglePoint(3, 3);
- assertTrue(n == 1);
-
- n = b.togglePoint(3, 3);
- assertTrue(n == 3);
-
- n = b.togglePoint(3, 2);
- assertTrue(n == 2);
-
- n = b.togglePoint(4, 2);
- assertTrue(n == 1);
-
- }
-
- @Test
- public void testDistance()
- {
- assertTrue(sb.distance(6, 4, 6, 4) == 0);
- assertTrue(sb.distance(6, 4, 5, 4) == 1);
- assertTrue(sb.distance(6, 4, 6, 5) == 1);
- assertTrue(sb.distance(6, 4, 7, 5) == 1);
- assertTrue(sb.distance(6, 4, 7, 4) == 1);
- assertTrue(sb.distance(6, 4, 6, 3) == 1);
- assertTrue(sb.distance(6, 4, 5, 3) == 1);
- assertTrue(sb.distance(6, 4, 4, 4) == 2);
- assertTrue(sb.distance(6, 4, 5, 5) == 2);
- assertTrue(sb.distance(6, 4, 6, 6) == 2);
- assertTrue(sb.distance(6, 4, 7, 6) == 2);
- assertTrue(sb.distance(6, 4, 8, 6) == 2);
- assertTrue(sb.distance(6, 4, 8, 5) == 2);
- assertTrue(sb.distance(6, 4, 8, 4) == 2);
- assertTrue(sb.distance(6, 4, 7, 3) == 2);
- assertTrue(sb.distance(6, 4, 6, 2) == 2);
- assertTrue(sb.distance(6, 4, 5, 2) == 2);
- assertTrue(sb.distance(6, 4, 4, 2) == 2);
- assertTrue(sb.distance(6, 4, 4, 3) == 2);
-
- assertTrue(sb.distance(6, 4, 9, 7) == 3);
- assertTrue(sb.distance(6, 4, 10, 8) == 4);
- assertTrue(sb.distance(6, 4, 6, 1) == 3);
- assertTrue(sb.distance(6, 4, 9, 6) == 3);
- assertTrue(sb.distance(6, 4, 9, 5) == 3);
- assertTrue(sb.distance(6, 4, 10, 6) == 4);
- assertTrue(sb.distance(6, 4, 3, 1) == 3);
- assertTrue(sb.distance(6, 4, 2, 0) == 4);
-
- assertTrue(sb.distance(6, 4, 9, 4) == 3);
- assertTrue(sb.distance(6, 4, 8, 4) == 2);
- assertTrue(sb.distance(6, 4, 9, 5) == 3);
- assertTrue(sb.distance(6, 4, 10, 5) == 4);
- assertTrue(sb.distance(6, 4, 10, 4) == 4);
- assertTrue(sb.distance(6, 4, 9, 3) == 4);
- assertTrue(sb.distance(6, 4, 8, 3) == 3);
-
- assertTrue(sb.distance(6, 4, 8, 2) == 4);
- assertTrue(sb.distance(6, 4, 7, 2) == 3);
- assertTrue(sb.distance(6, 4, 8, 3) == 3);
- assertTrue(sb.distance(6, 4, 9, 3) == 4);
- assertTrue(sb.distance(6, 4, 9, 2) == 5);
- assertTrue(sb.distance(6, 4, 8, 1) == 5);
- assertTrue(sb.distance(6, 4, 7, 1) == 4);
-
- assertTrue(sb.distance(6, 4, 2, 2) == 4);
- assertTrue(sb.distance(6, 4, 1, 2) == 5);
- assertTrue(sb.distance(6, 4, 2, 3) == 4);
- assertTrue(sb.distance(6, 4, 3, 3) == 3);
- assertTrue(sb.distance(6, 4, 3, 2) == 3);
- assertTrue(sb.distance(6, 4, 2, 1) == 4);
- assertTrue(sb.distance(6, 4, 1, 1) == 5);
-
- assertTrue(sb.distance(6, 4, 5, 7) == 4);
- assertTrue(sb.distance(6, 4, 4, 7) == 5);
- assertTrue(sb.distance(6, 4, 5, 8) == 5);
- assertTrue(sb.distance(6, 4, 6, 8) == 4);
- assertTrue(sb.distance(6, 4, 6, 7) == 3);
- assertTrue(sb.distance(6, 4, 5, 6) == 3);
- assertTrue(sb.distance(6, 4, 4, 6) == 4);
-
- assertTrue(sb.distance(6, 4, 8, 8) == 4);
- assertTrue(sb.distance(6, 4, 7, 8) == 4);
- assertTrue(sb.distance(6, 4, 1, 1) == 5);
- assertTrue(sb.distance(6, 4, 7, 0) == 5);
- assertTrue(sb.distance(6, 4, 9, 8) == 4);
- assertTrue(sb.distance(6, 4, 8, 7) == 3);
- assertTrue(sb.distance(6, 4, 7, 7) == 3);
- }
-
-}
diff --git a/core/test/ch/asynk/tankontank/Helpers.java b/core/test/ch/asynk/tankontank/Helpers.java
deleted file mode 100644
index 818f1a0..0000000
--- a/core/test/ch/asynk/tankontank/Helpers.java
+++ /dev/null
@@ -1,144 +0,0 @@
-package ch.asynk.rustanddust;
-
-import java.util.List;
-import java.util.ArrayList;
-import java.util.HashSet;
-
-import ch.asynk.rustanddust.engine.Pawn;
-import ch.asynk.rustanddust.engine.Tile;
-import ch.asynk.rustanddust.engine.Board;
-import ch.asynk.rustanddust.engine.Orientation;
-import ch.asynk.rustanddust.engine.SearchBoard;
-import ch.asynk.rustanddust.engine.PathBuilder;
-
-public class Helpers
-{
- public static class FakePawn extends Pawn
- {
- private int mvt;
- public FakePawn (int mvt)
- {
- this.mvt = mvt;
- }
-
- @Override public int getMovementPoints() { return mvt; }
- @Override public int getRoadMarchBonus() { return 1; }
- @Override public int getAngleOfAttack() { return 0; }
- @Override public int getFlankSides() { return 0; }
- @Override public int getDefense(Tile tile) { return 8; }
- @Override public int getEngagementRangeFrom(Tile tile) { return 3; }
-
- @Override public boolean isA(PawnId id) { return true; }
- @Override public boolean isA(PawnType type) { return true; }
- @Override public boolean isHq() { return true; }
- @Override public boolean isHqOf(Pawn other) { return true; }
- @Override public boolean isUnit() { return true; }
- @Override public boolean isHardTarget() { return true; }
- @Override public boolean isEnemy(Pawn other) { return true; }
-
- @Override public boolean canMove() { return true; }
- @Override public boolean canRotate() { return true; }
- @Override public boolean canEngage() { return true; }
- @Override public boolean canEngage(Pawn other) { return true; }
- @Override public boolean canAssistEngagementWithoutLos() { return true; }
-
- @Override public void move() { }
- @Override public void engage() { }
-
- @Override public void reset() { }
- @Override public void revertLastMove() { }
- }
-
- public static class FakeTile extends Tile
- {
- public boolean offMap;
-
- public FakeTile(int col, int row)
- {
- super(col, row);
- offMap = false;
- }
-
- public FakeTile(int col, int row, boolean offMap)
- {
- super(col, row);
- this.offMap = offMap;
- }
-
- @Override public boolean isOffMap()
- {
- return offMap;
- }
- @Override public int exitCost() { return 1; }
- @Override public int costFrom(Pawn pawn, Orientation side) { return 1; }
- @Override public int defense() { return 0; }
-
- @Override public boolean isA(TileTerrain terrain) { return true; }
- @Override public boolean road(Orientation side) { return false; }
- @Override public boolean atLeastOneMove(Pawn pawn) { return true; }
- @Override public boolean blockLineOfSightFrom(Tile from) { return false; }
- }
-
- public static class FakeSearchBoard extends SearchBoard
- {
- public FakeSearchBoard(Board b, int cols, int rows)
- {
- super(b, cols, rows);
- }
-
- public int distance(int col0, int row0, int col1, int row1)
- {
- return distance(getNode(col0, row0), getNode(col1, row1));
- }
- }
-
- public static class FakeBoard extends Board
- {
- public FakePawn pawn;
- public FakeTile fakeTiles[];
- public PathBuilder pathBuilder;
-
- public FakeBoard(int cols, int rows, int mvt)
- {
- super(cols, rows);
- fakeTiles = new FakeTile[(cols + 2) * (rows + 2)];
-
- int idx = 0;
- for (int i = -1; i < (rows + 1); i++) {
- for ( int j = -1; j < (cols + 1); j ++) {
- boolean offmap = ((j < 0) || (i < 0) || (j >= cols) || (i >= rows));
- fakeTiles[idx] = new FakeTile((j + ((i + 1) / 2)), i, offmap);
- idx += 1;
- }
- }
-
- fakeTiles[ 36 - 2].offMap = true;
- fakeTiles[ 60 - 2].offMap = true;
- fakeTiles[ 84 - 2].offMap = true;
- fakeTiles[108 - 2].offMap = true;
-
- pawn = new FakePawn(mvt);
- pathBuilder = new PathBuilder(this, 10, 20, 5, 10);
- }
-
- @Override
- public Tile getTile(int col, int row)
- {
- int i = getTileOffset(col, row);
- if (i < 0)
- return null;
- return fakeTiles[i];
- }
-
- public int buildPathBuilder(int x0, int y0, int x1, int y1)
- {
- pathBuilder.init(pawn, getTile(x0, y0));
- return pathBuilder.build(getTile(x1, y1));
- }
-
- public int togglePoint(int x, int y)
- {
- return pathBuilder.toggleCtrlTile(getTile(x, y));
- }
- }
-}
diff --git a/core/test/ch/asynk/tankontank/LineOfSightTest.java b/core/test/ch/asynk/tankontank/LineOfSightTest.java
deleted file mode 100644
index 60b95ab..0000000
--- a/core/test/ch/asynk/tankontank/LineOfSightTest.java
+++ /dev/null
@@ -1,1421 +0,0 @@
-package ch.asynk.rustanddust;
-
-import java.util.List;
-
-import org.junit.Test;
-import org.junit.Before;
-
-import ch.asynk.rustanddust.engine.SearchBoard;
-import ch.asynk.rustanddust.engine.SearchBoard.Node;
-
-import static org.junit.Assert.assertTrue;
-
-public class LineOfSightTest
-{
- private SearchBoard sb;
-
- @Before
- public void initialize()
- {
- int cols = 10;
- int rows = 9;
- Helpers.FakeBoard fakeBoard = new Helpers.FakeBoard(cols, rows, 0);
- sb = new SearchBoard(fakeBoard, cols, rows);
- }
-
- private void checkNode(List<Node> l, int i, int col, int row)
- {
- Node n = l.get(i);
- assertTrue(n.col == col);
- assertTrue(n.row == row);
- }
-
- private List<Node> lineOfSight(int x0, int y0, int x1, int y1)
- {
- return sb.lineOfSight(x0, y0, x1, y1, true);
- }
-
- // from bottom left
- @Test public void test_1() {
- List<Node> s = lineOfSight(0, 0, 2, 1);
- assertTrue(s.size() == 4);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 0);
- checkNode(s, 2, 1, 1);
- checkNode(s, 3, 2, 1);
- }
-
- @Test public void test_2() {
- List<Node> s = lineOfSight(0, 0, 5, 1);
- assertTrue(s.size() == 6);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 0);
- checkNode(s, 2, 2, 0);
- checkNode(s, 3, 3, 1);
- checkNode(s, 4, 4, 1);
- checkNode(s, 5, 5, 1);
- }
-
- @Test public void test_3() {
- List<Node> s = lineOfSight(0, 0, 8, 1);
- assertTrue(s.size() == 10);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 0);
- checkNode(s, 2, 2, 0);
- checkNode(s, 3, 3, 0);
- checkNode(s, 4, 4, 1);
- checkNode(s, 5, 4, 0);
- checkNode(s, 6, 5, 1);
- checkNode(s, 7, 6, 1);
- checkNode(s, 8, 7, 1);
- checkNode(s, 9, 8, 1);
- }
-
- @Test public void test_4() {
- List<Node> s = lineOfSight(0, 0, 1, 2);
- assertTrue(s.size() == 3);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 1);
- checkNode(s, 2, 1, 2);
- }
-
- @Test public void test_5() {
- List<Node> s = lineOfSight(0, 0, 4, 2);
- assertTrue(s.size() == 7);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 0);
- checkNode(s, 2, 1, 1);
- checkNode(s, 3, 2, 1);
- checkNode(s, 4, 3, 1);
- checkNode(s, 5, 3, 2);
- checkNode(s, 6, 4, 2);
- }
-
- @Test public void test_6() {
- List<Node> s = lineOfSight(0, 0, 7, 2);
- assertTrue(s.size() == 8);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 0);
- checkNode(s, 2, 2, 1);
- checkNode(s, 3, 3, 1);
- checkNode(s, 4, 4, 1);
- checkNode(s, 5, 5, 1);
- checkNode(s, 6, 6, 2);
- checkNode(s, 7, 7, 2);
- }
-
- @Test public void test_7() {
- List<Node> s = lineOfSight(0, 0, 10, 2);
- assertTrue(s.size() == 11);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 0);
- checkNode(s, 2, 2, 0);
- checkNode(s, 3, 3, 1);
- checkNode(s, 4, 4, 1);
- checkNode(s, 5, 5, 1);
- checkNode(s, 6, 6, 1);
- checkNode(s, 7, 7, 1);
- checkNode(s, 8, 8, 2);
- checkNode(s, 9, 9, 2);
- checkNode(s, 10, 10, 2);
- }
-
- @Test public void test_8() {
- List<Node> s = lineOfSight(0, 0, 6, 3);
- assertTrue(s.size() == 10);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 0);
- checkNode(s, 2, 1, 1);
- checkNode(s, 3, 2, 1);
- checkNode(s, 4, 3, 1);
- checkNode(s, 5, 3, 2);
- checkNode(s, 6, 4, 2);
- checkNode(s, 7, 5, 2);
- checkNode(s, 8, 5, 3);
- checkNode(s, 9, 6, 3);
- }
-
- @Test public void test_9() {
- List<Node> s = lineOfSight(0, 0, 2, 4);
- assertTrue(s.size() == 5);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 1);
- checkNode(s, 2, 1, 2);
- checkNode(s, 3, 2, 3);
- checkNode(s, 4, 2, 4);
- }
-
- @Test public void test_10() {
- List<Node> s = lineOfSight(0, 0, 5, 4);
- assertTrue(s.size() == 6);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 1);
- checkNode(s, 2, 2, 2);
- checkNode(s, 3, 3, 2);
- checkNode(s, 4, 4, 3);
- checkNode(s, 5, 5, 4);
- }
-
- @Test public void test_11() {
- List<Node> s = lineOfSight(0, 0, 8, 4);
- assertTrue(s.size() == 13);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 0);
- checkNode(s, 2, 1, 1);
- checkNode(s, 3, 2, 1);
- checkNode(s, 4, 3, 1);
- checkNode(s, 5, 3, 2);
- checkNode(s, 6, 4, 2);
- checkNode(s, 7, 5, 2);
- checkNode(s, 8, 5, 3);
- checkNode(s, 9, 6, 3);
- checkNode(s, 10, 7, 3);
- checkNode(s, 11, 7, 4);
- checkNode(s, 12, 8, 4);
- }
-
- @Test public void test_12() {
- List<Node> s = lineOfSight(0, 0, 11, 4);
- assertTrue(s.size() == 12);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 0);
- checkNode(s, 2, 2, 1);
- checkNode(s, 3, 3, 1);
- checkNode(s, 4, 4, 1);
- checkNode(s, 5, 5, 2);
- checkNode(s, 6, 6, 2);
- checkNode(s, 7, 7, 3);
- checkNode(s, 8, 8, 3);
- checkNode(s, 9, 9, 3);
- checkNode(s, 10, 10, 4);
- checkNode(s, 11, 11, 4);
- }
-
- @Test public void test_13() {
- List<Node> s = lineOfSight(0, 0, 4, 5);
- assertTrue(s.size() == 6);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 1);
- checkNode(s, 2, 2, 2);
- checkNode(s, 3, 2, 3);
- checkNode(s, 4, 3, 4);
- checkNode(s, 5, 4, 5);
- }
-
- @Test public void test_14() {
- List<Node> s = lineOfSight(0, 0, 7, 5);
- assertTrue(s.size() == 8);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 1);
- checkNode(s, 2, 2, 1);
- checkNode(s, 3, 3, 2);
- checkNode(s, 4, 4, 3);
- checkNode(s, 5, 5, 4);
- checkNode(s, 6, 6, 4);
- checkNode(s, 7, 7, 5);
- }
-
- @Test public void test_15() {
- List<Node> s = lineOfSight(0, 0, 10, 5);
- assertTrue(s.size() == 16);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 0);
- checkNode(s, 2, 1, 1);
- checkNode(s, 3, 2, 1);
- checkNode(s, 4, 3, 1);
- checkNode(s, 5, 3, 2);
- checkNode(s, 6, 4, 2);
- checkNode(s, 7, 5, 2);
- checkNode(s, 8, 5, 3);
- checkNode(s, 9, 6, 3);
- checkNode(s, 10, 7, 3);
- checkNode(s, 11, 7, 4);
- checkNode(s, 12, 8, 4);
- checkNode(s, 13, 9, 4);
- checkNode(s, 14, 9, 5);
- checkNode(s, 15, 10, 5);
- }
-
- @Test public void test_16() {
- List<Node> s = lineOfSight(0, 0, 3, 6);
- assertTrue(s.size() == 7);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 1);
- checkNode(s, 2, 1, 2);
- checkNode(s, 3, 2, 3);
- checkNode(s, 4, 2, 4);
- checkNode(s, 5, 3, 5);
- checkNode(s, 6, 3, 6);
- }
-
- @Test public void test_17() {
- List<Node> s = lineOfSight(0, 0, 12, 6);
- assertTrue(s.size() == 19);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 0);
- checkNode(s, 2, 1, 1);
- checkNode(s, 3, 2, 1);
- checkNode(s, 4, 3, 1);
- checkNode(s, 5, 3, 2);
- checkNode(s, 6, 4, 2);
- checkNode(s, 7, 5, 2);
- checkNode(s, 8, 5, 3);
- checkNode(s, 9, 6, 3);
- checkNode(s, 10, 7, 3);
- checkNode(s, 11, 7, 4);
- checkNode(s, 12, 8, 4);
- checkNode(s, 13, 9, 4);
- checkNode(s, 14, 9, 5);
- checkNode(s, 15, 10, 5);
- checkNode(s, 16, 11, 5);
- checkNode(s, 17, 11, 6);
- checkNode(s, 18, 12, 6);
- }
-
- @Test public void test_18() {
- List<Node> s = lineOfSight(0, 0, 5, 7);
- assertTrue(s.size() == 8);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 1);
- checkNode(s, 2, 1, 2);
- checkNode(s, 3, 2, 3);
- checkNode(s, 4, 3, 4);
- checkNode(s, 5, 4, 5);
- checkNode(s, 6, 4, 6);
- checkNode(s, 7, 5, 7);
- }
-
- @Test public void test_19() {
- List<Node> s = lineOfSight(0, 0, 8, 7);
- assertTrue(s.size() == 10);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 1);
- checkNode(s, 2, 2, 2);
- checkNode(s, 3, 3, 3);
- checkNode(s, 4, 4, 3);
- checkNode(s, 5, 4, 4);
- checkNode(s, 6, 5, 4);
- checkNode(s, 7, 6, 5);
- checkNode(s, 8, 7, 6);
- checkNode(s, 9, 8, 7);
- }
-
- @Test public void test_20() {
- List<Node> s = lineOfSight(0, 0, 11, 7);
- assertTrue(s.size() == 12);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 1);
- checkNode(s, 2, 2, 1);
- checkNode(s, 3, 3, 2);
- checkNode(s, 4, 4, 3);
- checkNode(s, 5, 5, 3);
- checkNode(s, 6, 6, 4);
- checkNode(s, 7, 7, 4);
- checkNode(s, 8, 8, 5);
- checkNode(s, 9, 9, 6);
- checkNode(s, 10, 10, 6);
- checkNode(s, 11, 11, 7);
- }
-
- @Test public void test_21() {
- List<Node> s = lineOfSight(0, 0, 4, 8);
- assertTrue(s.size() == 9);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 1);
- checkNode(s, 2, 1, 2);
- checkNode(s, 3, 2, 3);
- checkNode(s, 4, 2, 4);
- checkNode(s, 5, 3, 5);
- checkNode(s, 6, 3, 6);
- checkNode(s, 7, 4, 7);
- checkNode(s, 8, 4, 8);
- }
-
- @Test public void test_22() {
- List<Node> s = lineOfSight(0, 0, 7, 8);
- assertTrue(s.size() == 10);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 1);
- checkNode(s, 2, 2, 2);
- checkNode(s, 3, 3, 3);
- checkNode(s, 4, 3, 4);
- checkNode(s, 5, 4, 4);
- checkNode(s, 6, 4, 5);
- checkNode(s, 7, 5, 6);
- checkNode(s, 8, 6, 7);
- checkNode(s, 9, 7, 8);
- }
-
- @Test public void test_23() {
- List<Node> s = lineOfSight(0, 0, 10, 8);
- assertTrue(s.size() == 11);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 1);
- checkNode(s, 2, 2, 2);
- checkNode(s, 3, 3, 2);
- checkNode(s, 4, 4, 3);
- checkNode(s, 5, 5, 4);
- checkNode(s, 6, 6, 5);
- checkNode(s, 7, 7, 6);
- checkNode(s, 8, 8, 6);
- checkNode(s, 9, 9, 7);
- checkNode(s, 10, 10, 8);
- }
-
- @Test public void test_24() {
- List<Node> s = lineOfSight(0, 0, 13, 8);
- assertTrue(s.size() == 14);
- checkNode(s, 0, 0, 0);
- checkNode(s, 1, 1, 1);
- checkNode(s, 2, 2, 1);
- checkNode(s, 3, 3, 2);
- checkNode(s, 4, 4, 2);
- checkNode(s, 5, 5, 3);
- checkNode(s, 6, 6, 4);
- checkNode(s, 7, 7, 4);
- checkNode(s, 8, 8, 5);
- checkNode(s, 9, 9, 6);
- checkNode(s, 10, 10, 6);
- checkNode(s, 11, 11, 7);
- checkNode(s, 12, 12, 7);
- checkNode(s, 13, 13, 8);
- }
-
- // from top right
- @Test public void test_25() {
- List<Node> s = lineOfSight(13, 8, 11, 7);
- assertTrue(s.size() == 4);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 8);
- checkNode(s, 2, 12, 7);
- checkNode(s, 3, 11, 7);
- }
-
- @Test public void test_26() {
- List<Node> s = lineOfSight(13, 8, 8, 7);
- assertTrue(s.size() == 6);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 8);
- checkNode(s, 2, 11, 8);
- checkNode(s, 3, 10, 7);
- checkNode(s, 4, 9, 7);
- checkNode(s, 5, 8, 7);
- }
-
- @Test public void test_27() {
- List<Node> s = lineOfSight(13, 8, 5, 7);
- assertTrue(s.size() == 10);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 8);
- checkNode(s, 2, 11, 8);
- checkNode(s, 3, 10, 8);
- checkNode(s, 4, 9, 7);
- checkNode(s, 5, 9, 8);
- checkNode(s, 6, 8, 7);
- checkNode(s, 7, 7, 7);
- checkNode(s, 8, 6, 7);
- checkNode(s, 9, 5, 7);
- }
-
- @Test public void test_28() {
- List<Node> s = lineOfSight(13, 8, 12, 6);
- assertTrue(s.size() == 3);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 7);
- checkNode(s, 2, 12, 6);
- }
-
- @Test public void test_29() {
- List<Node> s = lineOfSight(13, 8, 9, 6);
- assertTrue(s.size() == 7);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 8);
- checkNode(s, 2, 12, 7);
- checkNode(s, 3, 11, 7);
- checkNode(s, 4, 10, 7);
- checkNode(s, 5, 10, 6);
- checkNode(s, 6, 9, 6);
- }
-
- @Test public void test_30() {
- List<Node> s = lineOfSight(13, 8, 6, 6);
- assertTrue(s.size() == 8);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 8);
- checkNode(s, 2, 11, 7);
- checkNode(s, 3, 10, 7);
- checkNode(s, 4, 9, 7);
- checkNode(s, 5, 8, 7);
- checkNode(s, 6, 7, 6);
- checkNode(s, 7, 6, 6);
- }
-
- @Test public void test_31() {
- List<Node> s = lineOfSight(13, 8, 3, 6);
- assertTrue(s.size() == 11);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 8);
- checkNode(s, 2, 11, 8);
- checkNode(s, 3, 10, 7);
- checkNode(s, 4, 9, 7);
- checkNode(s, 5, 8, 7);
- checkNode(s, 6, 7, 7);
- checkNode(s, 7, 6, 7);
- checkNode(s, 8, 5, 6);
- checkNode(s, 9, 4, 6);
- checkNode(s, 10, 3, 6);
- }
-
- @Test public void test_32() {
- List<Node> s = lineOfSight(13, 8, 7, 5);
- assertTrue(s.size() == 10);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 8);
- checkNode(s, 2, 12, 7);
- checkNode(s, 3, 11, 7);
- checkNode(s, 4, 10, 7);
- checkNode(s, 5, 10, 6);
- checkNode(s, 6, 9, 6);
- checkNode(s, 7, 8, 6);
- checkNode(s, 8, 8, 5);
- checkNode(s, 9, 7, 5);
- }
-
- @Test public void test_33() {
- List<Node> s = lineOfSight(13, 8, 11, 4);
- assertTrue(s.size() == 5);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 7);
- checkNode(s, 2, 12, 6);
- checkNode(s, 3, 11, 5);
- checkNode(s, 4, 11, 4);
- }
-
- @Test public void test_34() {
- List<Node> s = lineOfSight(13, 8, 8, 4);
- assertTrue(s.size() == 6);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 7);
- checkNode(s, 2, 11, 6);
- checkNode(s, 3, 10, 6);
- checkNode(s, 4, 9, 5);
- checkNode(s, 5, 8, 4);
- }
-
- @Test public void test_35() {
- List<Node> s = lineOfSight(13, 8, 5, 4);
- assertTrue(s.size() == 13);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 8);
- checkNode(s, 2, 12, 7);
- checkNode(s, 3, 11, 7);
- checkNode(s, 4, 10, 7);
- checkNode(s, 5, 10, 6);
- checkNode(s, 6, 9, 6);
- checkNode(s, 7, 8, 6);
- checkNode(s, 8, 8, 5);
- checkNode(s, 9, 7, 5);
- checkNode(s, 10, 6, 5);
- checkNode(s, 11, 6, 4);
- checkNode(s, 12, 5, 4);
- }
-
- @Test public void test_36() {
- List<Node> s = lineOfSight(13, 8, 2, 4);
- assertTrue(s.size() == 12);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 8);
- checkNode(s, 2, 11, 7);
- checkNode(s, 3, 10, 7);
- checkNode(s, 4, 9, 7);
- checkNode(s, 5, 8, 6);
- checkNode(s, 6, 7, 6);
- checkNode(s, 7, 6, 5);
- checkNode(s, 8, 5, 5);
- checkNode(s, 9, 4, 5);
- checkNode(s, 10, 3, 4);
- checkNode(s, 11, 2, 4);
- }
-
- @Test public void test_37() {
- List<Node> s = lineOfSight(13, 8, 9, 3);
- assertTrue(s.size() == 6);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 7);
- checkNode(s, 2, 11, 6);
- checkNode(s, 3, 11, 5);
- checkNode(s, 4, 10, 4);
- checkNode(s, 5, 9, 3);
- }
-
- @Test public void test_38() {
- List<Node> s = lineOfSight(13, 8, 6, 3);
- assertTrue(s.size() == 8);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 7);
- checkNode(s, 2, 11, 7);
- checkNode(s, 3, 10, 6);
- checkNode(s, 4, 9, 5);
- checkNode(s, 5, 8, 4);
- checkNode(s, 6, 7, 4);
- checkNode(s, 7, 6, 3);
- }
-
- @Test public void test_39() {
- List<Node> s = lineOfSight(13, 8, 3, 3);
- assertTrue(s.size() == 16);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 8);
- checkNode(s, 2, 12, 7);
- checkNode(s, 3, 11, 7);
- checkNode(s, 4, 10, 7);
- checkNode(s, 5, 10, 6);
- checkNode(s, 6, 9, 6);
- checkNode(s, 7, 8, 6);
- checkNode(s, 8, 8, 5);
- checkNode(s, 9, 7, 5);
- checkNode(s, 10, 6, 5);
- checkNode(s, 11, 6, 4);
- checkNode(s, 12, 5, 4);
- checkNode(s, 13, 4, 4);
- checkNode(s, 14, 4, 3);
- checkNode(s, 15, 3, 3);
- }
-
- @Test public void test_40() {
- List<Node> s = lineOfSight(13, 8, 10, 2);
- assertTrue(s.size() == 7);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 7);
- checkNode(s, 2, 12, 6);
- checkNode(s, 3, 11, 5);
- checkNode(s, 4, 11, 4);
- checkNode(s, 5, 10, 3);
- checkNode(s, 6, 10, 2);
- }
-
- @Test public void test_41() {
- List<Node> s = lineOfSight(13, 8, 1, 2);
- assertTrue(s.size() == 19);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 8);
- checkNode(s, 2, 12, 7);
- checkNode(s, 3, 11, 7);
- checkNode(s, 4, 10, 7);
- checkNode(s, 5, 10, 6);
- checkNode(s, 6, 9, 6);
- checkNode(s, 7, 8, 6);
- checkNode(s, 8, 8, 5);
- checkNode(s, 9, 7, 5);
- checkNode(s, 10, 6, 5);
- checkNode(s, 11, 6, 4);
- checkNode(s, 12, 5, 4);
- checkNode(s, 13, 4, 4);
- checkNode(s, 14, 4, 3);
- checkNode(s, 15, 3, 3);
- checkNode(s, 16, 2, 3);
- checkNode(s, 17, 2, 2);
- checkNode(s, 18, 1, 2);
- }
-
- @Test public void test_42() {
- List<Node> s = lineOfSight(13, 8, 8, 1);
- assertTrue(s.size() == 8);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 7);
- checkNode(s, 2, 12, 6);
- checkNode(s, 3, 11, 5);
- checkNode(s, 4, 10, 4);
- checkNode(s, 5, 9, 3);
- checkNode(s, 6, 9, 2);
- checkNode(s, 7, 8, 1);
- }
-
- @Test public void test_43() {
- List<Node> s = lineOfSight(13, 8, 5, 1);
- assertTrue(s.size() == 10);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 7);
- checkNode(s, 2, 11, 6);
- checkNode(s, 3, 10, 5);
- checkNode(s, 4, 9, 5);
- checkNode(s, 5, 9, 4);
- checkNode(s, 6, 8, 4);
- checkNode(s, 7, 7, 3);
- checkNode(s, 8, 6, 2);
- checkNode(s, 9, 5, 1);
- }
-
- @Test public void test_44() {
- List<Node> s = lineOfSight(13, 8, 2, 1);
- assertTrue(s.size() == 12);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 7);
- checkNode(s, 2, 11, 7);
- checkNode(s, 3, 10, 6);
- checkNode(s, 4, 9, 5);
- checkNode(s, 5, 8, 5);
- checkNode(s, 6, 7, 4);
- checkNode(s, 7, 6, 4);
- checkNode(s, 8, 5, 3);
- checkNode(s, 9, 4, 2);
- checkNode(s, 10, 3, 2);
- checkNode(s, 11, 2, 1);
- }
-
- @Test public void test_45() {
- List<Node> s = lineOfSight(13, 8, 9, 0);
- assertTrue(s.size() == 9);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 7);
- checkNode(s, 2, 12, 6);
- checkNode(s, 3, 11, 5);
- checkNode(s, 4, 11, 4);
- checkNode(s, 5, 10, 3);
- checkNode(s, 6, 10, 2);
- checkNode(s, 7, 9, 1);
- checkNode(s, 8, 9, 0);
- }
-
- @Test public void test_46() {
- List<Node> s = lineOfSight(13, 8, 6, 0);
- assertTrue(s.size() == 10);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 7);
- checkNode(s, 2, 11, 6);
- checkNode(s, 3, 10, 5);
- checkNode(s, 4, 10, 4);
- checkNode(s, 5, 9, 4);
- checkNode(s, 6, 9, 3);
- checkNode(s, 7, 8, 2);
- checkNode(s, 8, 7, 1);
- checkNode(s, 9, 6, 0);
- }
-
- @Test public void test_47() {
- List<Node> s = lineOfSight(13, 8, 3, 0);
- assertTrue(s.size() == 11);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 7);
- checkNode(s, 2, 11, 6);
- checkNode(s, 3, 10, 6);
- checkNode(s, 4, 9, 5);
- checkNode(s, 5, 8, 4);
- checkNode(s, 6, 7, 3);
- checkNode(s, 7, 6, 2);
- checkNode(s, 8, 5, 2);
- checkNode(s, 9, 4, 1);
- checkNode(s, 10, 3, 0);
- }
-
- @Test public void test_48() {
- List<Node> s = lineOfSight(13, 8, 0, 0);
- assertTrue(s.size() == 14);
- checkNode(s, 0, 13, 8);
- checkNode(s, 1, 12, 7);
- checkNode(s, 2, 11, 7);
- checkNode(s, 3, 10, 6);
- checkNode(s, 4, 9, 6);
- checkNode(s, 5, 8, 5);
- checkNode(s, 6, 7, 4);
- checkNode(s, 7, 6, 4);
- checkNode(s, 8, 5, 3);
- checkNode(s, 9, 4, 2);
- checkNode(s, 10, 3, 2);
- checkNode(s, 11, 2, 1);
- checkNode(s, 12, 1, 1);
- checkNode(s, 13, 0, 0);
- }
-
- // from top left
- @Test public void test_49() {
- List<Node> s = lineOfSight(4, 8, 5, 7);
- assertTrue(s.size() == 4);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 5, 8);
- checkNode(s, 2, 4, 7);
- checkNode(s, 3, 5, 7);
- }
-
- @Test public void test_50() {
- List<Node> s = lineOfSight(4, 8, 8, 7);
- assertTrue(s.size() == 6);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 5, 8);
- checkNode(s, 2, 6, 8);
- checkNode(s, 3, 6, 7);
- checkNode(s, 4, 7, 7);
- checkNode(s, 5, 8, 7);
- }
-
- @Test public void test_51() {
- List<Node> s = lineOfSight(4, 8, 11, 7);
- assertTrue(s.size() == 10);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 5, 8);
- checkNode(s, 2, 6, 8);
- checkNode(s, 3, 7, 8);
- checkNode(s, 4, 7, 7);
- checkNode(s, 5, 8, 8);
- checkNode(s, 6, 8, 7);
- checkNode(s, 7, 9, 7);
- checkNode(s, 8, 10, 7);
- checkNode(s, 9, 11, 7);
- }
-
- @Test public void test_52() {
- List<Node> s = lineOfSight(4, 8, 3, 6);
- assertTrue(s.size() == 3);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 4, 7);
- checkNode(s, 2, 3, 6);
- }
-
- @Test public void test_53() {
- List<Node> s = lineOfSight(4, 8, 6, 6);
- assertTrue(s.size() == 7);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 5, 8);
- checkNode(s, 2, 4, 7);
- checkNode(s, 3, 5, 7);
- checkNode(s, 4, 6, 7);
- checkNode(s, 5, 5, 6);
- checkNode(s, 6, 6, 6);
- }
-
- @Test public void test_54() {
- List<Node> s = lineOfSight(4, 8, 9, 6);
- assertTrue(s.size() == 8);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 5, 8);
- checkNode(s, 2, 5, 7);
- checkNode(s, 3, 6, 7);
- checkNode(s, 4, 7, 7);
- checkNode(s, 5, 8, 7);
- checkNode(s, 6, 8, 6);
- checkNode(s, 7, 9, 6);
- }
-
- @Test public void test_55() {
- List<Node> s = lineOfSight(4, 8, 12, 6);
- assertTrue(s.size() == 11);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 5, 8);
- checkNode(s, 2, 6, 8);
- checkNode(s, 3, 6, 7);
- checkNode(s, 4, 7, 7);
- checkNode(s, 5, 8, 7);
- checkNode(s, 6, 9, 7);
- checkNode(s, 7, 10, 7);
- checkNode(s, 8, 10, 6);
- checkNode(s, 9, 11, 6);
- checkNode(s, 10, 12, 6);
- }
-
- @Test public void test_56() {
- List<Node> s = lineOfSight(4, 8, 7, 5);
- assertTrue(s.size() == 10);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 5, 8);
- checkNode(s, 2, 4, 7);
- checkNode(s, 3, 5, 7);
- checkNode(s, 4, 6, 7);
- checkNode(s, 5, 5, 6);
- checkNode(s, 6, 6, 6);
- checkNode(s, 7, 7, 6);
- checkNode(s, 8, 6, 5);
- checkNode(s, 9, 7, 5);
- }
-
- @Test public void test_57() {
- List<Node> s = lineOfSight(4, 8, 2, 4);
- assertTrue(s.size() == 5);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 4, 7);
- checkNode(s, 2, 3, 6);
- checkNode(s, 3, 3, 5);
- checkNode(s, 4, 2, 4);
- }
-
- @Test public void test_58() {
- List<Node> s = lineOfSight(4, 8, 5, 4);
- assertTrue(s.size() == 6);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 4, 7);
- checkNode(s, 2, 4, 6);
- checkNode(s, 3, 5, 6);
- checkNode(s, 4, 5, 5);
- checkNode(s, 5, 5, 4);
- }
-
- @Test public void test_59() {
- List<Node> s = lineOfSight(4, 8, 8, 4);
- assertTrue(s.size() == 13);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 5, 8);
- checkNode(s, 2, 4, 7);
- checkNode(s, 3, 5, 7);
- checkNode(s, 4, 6, 7);
- checkNode(s, 5, 5, 6);
- checkNode(s, 6, 6, 6);
- checkNode(s, 7, 7, 6);
- checkNode(s, 8, 6, 5);
- checkNode(s, 9, 7, 5);
- checkNode(s, 10, 8, 5);
- checkNode(s, 11, 7, 4);
- checkNode(s, 12, 8, 4);
- }
-
- @Test public void test_60() {
- List<Node> s = lineOfSight(4, 8, 11, 4);
- assertTrue(s.size() == 12);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 5, 8);
- checkNode(s, 2, 5, 7);
- checkNode(s, 3, 6, 7);
- checkNode(s, 4, 7, 7);
- checkNode(s, 5, 7, 6);
- checkNode(s, 6, 8, 6);
- checkNode(s, 7, 8, 5);
- checkNode(s, 8, 9, 5);
- checkNode(s, 9, 10, 5);
- checkNode(s, 10, 10, 4);
- checkNode(s, 11, 11, 4);
- }
-
- @Test public void test_61() {
- List<Node> s = lineOfSight(4, 8, 3, 3);
- assertTrue(s.size() == 6);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 4, 7);
- checkNode(s, 2, 4, 6);
- checkNode(s, 3, 3, 5);
- checkNode(s, 4, 3, 4);
- checkNode(s, 5, 3, 3);
- }
-
- @Test public void test_62() {
- List<Node> s = lineOfSight(4, 8, 6, 3);
- assertTrue(s.size() == 8);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 4, 7);
- checkNode(s, 2, 5, 7);
- checkNode(s, 3, 5, 6);
- checkNode(s, 4, 5, 5);
- checkNode(s, 5, 5, 4);
- checkNode(s, 6, 6, 4);
- checkNode(s, 7, 6, 3);
- }
-
- @Test public void test_63() {
- List<Node> s = lineOfSight(4, 8, 9, 3);
- assertTrue(s.size() == 16);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 5, 8);
- checkNode(s, 2, 4, 7);
- checkNode(s, 3, 5, 7);
- checkNode(s, 4, 6, 7);
- checkNode(s, 5, 5, 6);
- checkNode(s, 6, 6, 6);
- checkNode(s, 7, 7, 6);
- checkNode(s, 8, 6, 5);
- checkNode(s, 9, 7, 5);
- checkNode(s, 10, 8, 5);
- checkNode(s, 11, 7, 4);
- checkNode(s, 12, 8, 4);
- checkNode(s, 13, 9, 4);
- checkNode(s, 14, 8, 3);
- checkNode(s, 15, 9, 3);
- }
-
- @Test public void test_64() {
- List<Node> s = lineOfSight(4, 8, 1, 2);
- assertTrue(s.size() == 7);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 4, 7);
- checkNode(s, 2, 3, 6);
- checkNode(s, 3, 3, 5);
- checkNode(s, 4, 2, 4);
- checkNode(s, 5, 2, 3);
- checkNode(s, 6, 1, 2);
- }
-
- @Test public void test_65() {
- List<Node> s = lineOfSight(4, 8, 10, 2);
- assertTrue(s.size() == 19);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 5, 8);
- checkNode(s, 2, 4, 7);
- checkNode(s, 3, 5, 7);
- checkNode(s, 4, 6, 7);
- checkNode(s, 5, 5, 6);
- checkNode(s, 6, 6, 6);
- checkNode(s, 7, 7, 6);
- checkNode(s, 8, 6, 5);
- checkNode(s, 9, 7, 5);
- checkNode(s, 10, 8, 5);
- checkNode(s, 11, 7, 4);
- checkNode(s, 12, 8, 4);
- checkNode(s, 13, 9, 4);
- checkNode(s, 14, 8, 3);
- checkNode(s, 15, 9, 3);
- checkNode(s, 16, 10, 3);
- checkNode(s, 17, 9, 2);
- checkNode(s, 18, 10, 2);
- }
-
- @Test public void test_66() {
- List<Node> s = lineOfSight(4, 8, 2, 1);
- assertTrue(s.size() == 8);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 4, 7);
- checkNode(s, 2, 3, 6);
- checkNode(s, 3, 3, 5);
- checkNode(s, 4, 3, 4);
- checkNode(s, 5, 3, 3);
- checkNode(s, 6, 2, 2);
- checkNode(s, 7, 2, 1);
- }
-
- @Test public void test_67() {
- List<Node> s = lineOfSight(4, 8, 5, 1);
- assertTrue(s.size() == 10);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 4, 7);
- checkNode(s, 2, 4, 6);
- checkNode(s, 3, 4, 5);
- checkNode(s, 4, 5, 5);
- checkNode(s, 5, 4, 4);
- checkNode(s, 6, 5, 4);
- checkNode(s, 7, 5, 3);
- checkNode(s, 8, 5, 2);
- checkNode(s, 9, 5, 1);
- }
-
- @Test public void test_68() {
- List<Node> s = lineOfSight(4, 8, 8, 1);
- assertTrue(s.size() == 12);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 4, 7);
- checkNode(s, 2, 5, 7);
- checkNode(s, 3, 5, 6);
- checkNode(s, 4, 5, 5);
- checkNode(s, 5, 6, 5);
- checkNode(s, 6, 6, 4);
- checkNode(s, 7, 7, 4);
- checkNode(s, 8, 7, 3);
- checkNode(s, 9, 7, 2);
- checkNode(s, 10, 8, 2);
- checkNode(s, 11, 8, 1);
- }
-
- @Test public void test_69() {
- List<Node> s = lineOfSight(4, 8, 0, 0);
- assertTrue(s.size() == 9);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 4, 7);
- checkNode(s, 2, 3, 6);
- checkNode(s, 3, 3, 5);
- checkNode(s, 4, 2, 4);
- checkNode(s, 5, 2, 3);
- checkNode(s, 6, 1, 2);
- checkNode(s, 7, 1, 1);
- checkNode(s, 8, 0, 0);
- }
-
- @Test public void test_70() {
- List<Node> s = lineOfSight(4, 8, 3, 0);
- assertTrue(s.size() == 10);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 4, 7);
- checkNode(s, 2, 4, 6);
- checkNode(s, 3, 4, 5);
- checkNode(s, 4, 3, 4);
- checkNode(s, 5, 4, 4);
- checkNode(s, 6, 3, 3);
- checkNode(s, 7, 3, 2);
- checkNode(s, 8, 3, 1);
- checkNode(s, 9, 3, 0);
- }
-
- @Test public void test_71() {
- List<Node> s = lineOfSight(4, 8, 6, 0);
- assertTrue(s.size() == 11);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 4, 7);
- checkNode(s, 2, 4, 6);
- checkNode(s, 3, 5, 6);
- checkNode(s, 4, 5, 5);
- checkNode(s, 5, 5, 4);
- checkNode(s, 6, 5, 3);
- checkNode(s, 7, 5, 2);
- checkNode(s, 8, 6, 2);
- checkNode(s, 9, 6, 1);
- checkNode(s, 10, 6, 0);
- }
-
- @Test public void test_72() {
- List<Node> s = lineOfSight(4, 8, 9, 0);
- assertTrue(s.size() == 14);
- checkNode(s, 0, 4, 8);
- checkNode(s, 1, 4, 7);
- checkNode(s, 2, 5, 7);
- checkNode(s, 3, 5, 6);
- checkNode(s, 4, 6, 6);
- checkNode(s, 5, 6, 5);
- checkNode(s, 6, 6, 4);
- checkNode(s, 7, 7, 4);
- checkNode(s, 8, 7, 3);
- checkNode(s, 9, 7, 2);
- checkNode(s, 10, 8, 2);
- checkNode(s, 11, 8, 1);
- checkNode(s, 12, 9, 1);
- checkNode(s, 13, 9, 0);
- }
-
- // from bottom right
- @Test public void test_73() {
- List<Node> s = lineOfSight(9, 0, 8, 1);
- assertTrue(s.size() == 4);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 8, 0);
- checkNode(s, 2, 9, 1);
- checkNode(s, 3, 8, 1);
- }
-
- @Test public void test_74() {
- List<Node> s = lineOfSight(9, 0, 5, 1);
- assertTrue(s.size() == 6);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 8, 0);
- checkNode(s, 2, 7, 0);
- checkNode(s, 3, 7, 1);
- checkNode(s, 4, 6, 1);
- checkNode(s, 5, 5, 1);
- }
-
- @Test public void test_75() {
- List<Node> s = lineOfSight(9, 0, 2, 1);
- assertTrue(s.size() == 10);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 8, 0);
- checkNode(s, 2, 7, 0);
- checkNode(s, 3, 6, 0);
- checkNode(s, 4, 6, 1);
- checkNode(s, 5, 5, 0);
- checkNode(s, 6, 5, 1);
- checkNode(s, 7, 4, 1);
- checkNode(s, 8, 3, 1);
- checkNode(s, 9, 2, 1);
- }
-
- @Test public void test_76() {
- List<Node> s = lineOfSight(9, 0, 10, 2);
- assertTrue(s.size() == 3);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 9, 1);
- checkNode(s, 2, 10, 2);
- }
-
- @Test public void test_77() {
- List<Node> s = lineOfSight(9, 0, 7, 2);
- assertTrue(s.size() == 7);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 8, 0);
- checkNode(s, 2, 9, 1);
- checkNode(s, 3, 8, 1);
- checkNode(s, 4, 7, 1);
- checkNode(s, 5, 8, 2);
- checkNode(s, 6, 7, 2);
- }
-
- @Test public void test_78() {
- List<Node> s = lineOfSight(9, 0, 4, 2);
- assertTrue(s.size() == 8);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 8, 0);
- checkNode(s, 2, 8, 1);
- checkNode(s, 3, 7, 1);
- checkNode(s, 4, 6, 1);
- checkNode(s, 5, 5, 1);
- checkNode(s, 6, 5, 2);
- checkNode(s, 7, 4, 2);
- }
-
- @Test public void test_79() {
- List<Node> s = lineOfSight(9, 0, 1, 2);
- assertTrue(s.size() == 11);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 8, 0);
- checkNode(s, 2, 7, 0);
- checkNode(s, 3, 7, 1);
- checkNode(s, 4, 6, 1);
- checkNode(s, 5, 5, 1);
- checkNode(s, 6, 4, 1);
- checkNode(s, 7, 3, 1);
- checkNode(s, 8, 3, 2);
- checkNode(s, 9, 2, 2);
- checkNode(s, 10, 1, 2);
- }
-
- @Test public void test_80() {
- List<Node> s = lineOfSight(9, 0, 6, 3);
- assertTrue(s.size() == 10);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 8, 0);
- checkNode(s, 2, 9, 1);
- checkNode(s, 3, 8, 1);
- checkNode(s, 4, 7, 1);
- checkNode(s, 5, 8, 2);
- checkNode(s, 6, 7, 2);
- checkNode(s, 7, 6, 2);
- checkNode(s, 8, 7, 3);
- checkNode(s, 9, 6, 3);
- }
-
- @Test public void test_81() {
- List<Node> s = lineOfSight(9, 0, 11, 4);
- assertTrue(s.size() == 5);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 9, 1);
- checkNode(s, 2, 10, 2);
- checkNode(s, 3, 10, 3);
- checkNode(s, 4, 11, 4);
- }
-
- @Test public void test_82() {
- List<Node> s = lineOfSight(9, 0, 8, 4);
- assertTrue(s.size() == 6);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 9, 1);
- checkNode(s, 2, 9, 2);
- checkNode(s, 3, 8, 2);
- checkNode(s, 4, 8, 3);
- checkNode(s, 5, 8, 4);
- }
-
- @Test public void test_83() {
- List<Node> s = lineOfSight(9, 0, 5, 4);
- assertTrue(s.size() == 13);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 8, 0);
- checkNode(s, 2, 9, 1);
- checkNode(s, 3, 8, 1);
- checkNode(s, 4, 7, 1);
- checkNode(s, 5, 8, 2);
- checkNode(s, 6, 7, 2);
- checkNode(s, 7, 6, 2);
- checkNode(s, 8, 7, 3);
- checkNode(s, 9, 6, 3);
- checkNode(s, 10, 5, 3);
- checkNode(s, 11, 6, 4);
- checkNode(s, 12, 5, 4);
- }
-
- @Test public void test_84() {
- List<Node> s = lineOfSight(9, 0, 2, 4);
- assertTrue(s.size() == 12);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 8, 0);
- checkNode(s, 2, 8, 1);
- checkNode(s, 3, 7, 1);
- checkNode(s, 4, 6, 1);
- checkNode(s, 5, 6, 2);
- checkNode(s, 6, 5, 2);
- checkNode(s, 7, 5, 3);
- checkNode(s, 8, 4, 3);
- checkNode(s, 9, 3, 3);
- checkNode(s, 10, 3, 4);
- checkNode(s, 11, 2, 4);
- }
-
- @Test public void test_85() {
- List<Node> s = lineOfSight(9, 0, 10, 5);
- assertTrue(s.size() == 6);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 9, 1);
- checkNode(s, 2, 9, 2);
- checkNode(s, 3, 10, 3);
- checkNode(s, 4, 10, 4);
- checkNode(s, 5, 10, 5);
- }
-
- @Test public void test_86() {
- List<Node> s = lineOfSight(9, 0, 7, 5);
- assertTrue(s.size() == 8);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 9, 1);
- checkNode(s, 2, 8, 1);
- checkNode(s, 3, 8, 2);
- checkNode(s, 4, 8, 3);
- checkNode(s, 5, 8, 4);
- checkNode(s, 6, 7, 4);
- checkNode(s, 7, 7, 5);
- }
-
- @Test public void test_87() {
- List<Node> s = lineOfSight(9, 0, 4, 5);
- assertTrue(s.size() == 16);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 8, 0);
- checkNode(s, 2, 9, 1);
- checkNode(s, 3, 8, 1);
- checkNode(s, 4, 7, 1);
- checkNode(s, 5, 8, 2);
- checkNode(s, 6, 7, 2);
- checkNode(s, 7, 6, 2);
- checkNode(s, 8, 7, 3);
- checkNode(s, 9, 6, 3);
- checkNode(s, 10, 5, 3);
- checkNode(s, 11, 6, 4);
- checkNode(s, 12, 5, 4);
- checkNode(s, 13, 4, 4);
- checkNode(s, 14, 5, 5);
- checkNode(s, 15, 4, 5);
- }
-
- @Test public void test_88() {
- List<Node> s = lineOfSight(9, 0, 12, 6);
- assertTrue(s.size() == 7);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 9, 1);
- checkNode(s, 2, 10, 2);
- checkNode(s, 3, 10, 3);
- checkNode(s, 4, 11, 4);
- checkNode(s, 5, 11, 5);
- checkNode(s, 6, 12, 6);
- }
-
- @Test public void test_89() {
- List<Node> s = lineOfSight(9, 0, 3, 6);
- assertTrue(s.size() == 19);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 8, 0);
- checkNode(s, 2, 9, 1);
- checkNode(s, 3, 8, 1);
- checkNode(s, 4, 7, 1);
- checkNode(s, 5, 8, 2);
- checkNode(s, 6, 7, 2);
- checkNode(s, 7, 6, 2);
- checkNode(s, 8, 7, 3);
- checkNode(s, 9, 6, 3);
- checkNode(s, 10, 5, 3);
- checkNode(s, 11, 6, 4);
- checkNode(s, 12, 5, 4);
- checkNode(s, 13, 4, 4);
- checkNode(s, 14, 5, 5);
- checkNode(s, 15, 4, 5);
- checkNode(s, 16, 3, 5);
- checkNode(s, 17, 4, 6);
- checkNode(s, 18, 3, 6);
- }
-
- @Test public void test_90() {
- List<Node> s = lineOfSight(9, 0, 11, 7);
- assertTrue(s.size() == 8);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 9, 1);
- checkNode(s, 2, 10, 2);
- checkNode(s, 3, 10, 3);
- checkNode(s, 4, 10, 4);
- checkNode(s, 5, 10, 5);
- checkNode(s, 6, 11, 6);
- checkNode(s, 7, 11, 7);
- }
-
- @Test public void test_91() {
- List<Node> s = lineOfSight(9, 0, 8, 7);
- assertTrue(s.size() == 10);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 9, 1);
- checkNode(s, 2, 9, 2);
- checkNode(s, 3, 9, 3);
- checkNode(s, 4, 8, 3);
- checkNode(s, 5, 9, 4);
- checkNode(s, 6, 8, 4);
- checkNode(s, 7, 8, 5);
- checkNode(s, 8, 8, 6);
- checkNode(s, 9, 8, 7);
- }
-
- @Test public void test_92() {
- List<Node> s = lineOfSight(9, 0, 5, 7);
- assertTrue(s.size() == 12);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 9, 1);
- checkNode(s, 2, 8, 1);
- checkNode(s, 3, 8, 2);
- checkNode(s, 4, 8, 3);
- checkNode(s, 5, 7, 3);
- checkNode(s, 6, 7, 4);
- checkNode(s, 7, 6, 4);
- checkNode(s, 8, 6, 5);
- checkNode(s, 9, 6, 6);
- checkNode(s, 10, 5, 6);
- checkNode(s, 11, 5, 7);
- }
-
- @Test public void test_93() {
- List<Node> s = lineOfSight(9, 0, 13, 8);
- assertTrue(s.size() == 9);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 9, 1);
- checkNode(s, 2, 10, 2);
- checkNode(s, 3, 10, 3);
- checkNode(s, 4, 11, 4);
- checkNode(s, 5, 11, 5);
- checkNode(s, 6, 12, 6);
- checkNode(s, 7, 12, 7);
- checkNode(s, 8, 13, 8);
- }
-
- @Test public void test_94() {
- List<Node> s = lineOfSight(9, 0, 10, 8);
- assertTrue(s.size() == 10);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 9, 1);
- checkNode(s, 2, 9, 2);
- checkNode(s, 3, 9, 3);
- checkNode(s, 4, 10, 4);
- checkNode(s, 5, 9, 4);
- checkNode(s, 6, 10, 5);
- checkNode(s, 7, 10, 6);
- checkNode(s, 8, 10, 7);
- checkNode(s, 9, 10, 8);
- }
-
- @Test public void test_95() {
- List<Node> s = lineOfSight(9, 0, 7, 8);
- assertTrue(s.size() == 11);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 9, 1);
- checkNode(s, 2, 9, 2);
- checkNode(s, 3, 8, 2);
- checkNode(s, 4, 8, 3);
- checkNode(s, 5, 8, 4);
- checkNode(s, 6, 8, 5);
- checkNode(s, 7, 8, 6);
- checkNode(s, 8, 7, 6);
- checkNode(s, 9, 7, 7);
- checkNode(s, 10, 7, 8);
- }
-
- @Test public void test_96() {
- List<Node> s = lineOfSight(9, 0, 4, 8);
- assertTrue(s.size() == 14);
- checkNode(s, 0, 9, 0);
- checkNode(s, 1, 9, 1);
- checkNode(s, 2, 8, 1);
- checkNode(s, 3, 8, 2);
- checkNode(s, 4, 7, 2);
- checkNode(s, 5, 7, 3);
- checkNode(s, 6, 7, 4);
- checkNode(s, 7, 6, 4);
- checkNode(s, 8, 6, 5);
- checkNode(s, 9, 6, 6);
- checkNode(s, 10, 5, 6);
- checkNode(s, 11, 5, 7);
- checkNode(s, 12, 4, 7);
- checkNode(s, 13, 4, 8);
- }
-}