diff --git a/frontend/index.html b/frontend/index.html index 16e6a53..572efd6 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -13,7 +13,6 @@
- - + \ No newline at end of file diff --git a/frontend/js/main.js b/frontend/js/main.js index b234ee4..8fd4b03 100644 --- a/frontend/js/main.js +++ b/frontend/js/main.js @@ -64,7 +64,6 @@ class Agent{ } showAgent(){ - console.log(this.turn) if(this.turn === "Up"){ document.getElementById(this.positionX + "-" + this.positionY).style.backgroundImage = "url('img/Up.png')"; } @@ -228,16 +227,24 @@ function showBoard(board){ } } +function getDistance(x1,y1,x2,y2){ + var a = x1 - x2; + var b = y1 - y2; + var c = Math.sqrt(a*a + b*b); + return c +} + + let board = createBoard(10,10); board = createShelf(board); let agent = new Agent(0,0, 'Right'); function start(){ - let board = createBoard(10,10); - let agent = new Agent(0,0, 'Right'); showBoard(board); - agent.showAgent() + agent.showAgent(); + + console.log(getDistance(2,1,0,3)) }