diff --git a/shared/javaScript.js b/shared/javaScript.js index e758e9a..e7acc21 100644 --- a/shared/javaScript.js +++ b/shared/javaScript.js @@ -1,10 +1,3 @@ -var Position = /** @class */ (function () { - function Position(x, y) { - this.x = x; - this.y = y; - } - return Position; -}()); function memoryGap() { return memorySide() + memorySpace(); } @@ -20,7 +13,8 @@ function memoryItemPositions(c) { var row = Math.floor(i / 4); var x = memoryGap() + (i - row * 4) * memoryGap(); var y = memoryGap() + row * memoryGap(); - pos.push(new Position(x, y)); + // @ts-ignore + pos.push(memoryCreatePosition(x, y)); } return pos; } diff --git a/shared/typeScript.ts b/shared/typeScript.ts index 6c7cccc..5ff9050 100644 --- a/shared/typeScript.ts +++ b/shared/typeScript.ts @@ -2,14 +2,9 @@ interface Context { itemsCount: number } -class Position { +interface Position { x: number y: number - - constructor(x, y) { - this.x = x - this.y = y - } } function memoryGap(): number { @@ -30,7 +25,8 @@ function memoryItemPositions(c: Context): Position[] { let row = Math.floor(i / 4) let x = memoryGap() + (i - row * 4) * memoryGap() let y = memoryGap() + row * memoryGap() - pos.push(new Position(x, y)) + // @ts-ignore + pos.push(memoryCreatePosition(x, y)) } return pos } diff --git a/web/memory.html b/web/memory.html index 1edab03..d7d6aeb 100644 --- a/web/memory.html +++ b/web/memory.html @@ -6,6 +6,7 @@ +