mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2024-12-25 22:10:43 -05:00
feat: finished knights
This commit is contained in:
parent
2eb3956145
commit
6f8a4ec879
1 changed files with 5 additions and 3 deletions
|
@ -103,10 +103,10 @@ class Graph {
|
||||||
|
|
||||||
for (
|
for (
|
||||||
let i = 0;
|
let i = 0;
|
||||||
i < this.adjList[vertex[0]][vertex[1]].length;
|
i < this.adjList[vertex[1]][vertex[0]].length;
|
||||||
i++
|
i++
|
||||||
) {
|
) {
|
||||||
let neighbor = this.adjList[vertex[0]][vertex[1]][i];
|
let neighbor = this.adjList[vertex[1]][vertex[0]][i];
|
||||||
let x = neighbor[0];
|
let x = neighbor[0];
|
||||||
let y = neighbor[1];
|
let y = neighbor[1];
|
||||||
|
|
||||||
|
@ -146,7 +146,9 @@ class Graph {
|
||||||
}
|
}
|
||||||
|
|
||||||
let g = new Graph(8, 8);
|
let g = new Graph(8, 8);
|
||||||
console.log(g.adjList[1][2]);
|
console.dir(g.adjList);
|
||||||
|
console.table(g.adjList[0]);
|
||||||
|
console.table(g.adjList[0][0]);
|
||||||
g.knightMoves([0, 0], [7, 7]);
|
g.knightMoves([0, 0], [7, 7]);
|
||||||
console.log(g.lookAtBfs());
|
console.log(g.lookAtBfs());
|
||||||
g.knightMoves([0, 0], [3, 3]);
|
g.knightMoves([0, 0], [3, 3]);
|
||||||
|
|
Loading…
Reference in a new issue