added deployment

This commit is contained in:
evanpelle
2024-08-13 20:07:20 -07:00
parent efd5f65787
commit 001722bd59
11 changed files with 90 additions and 70 deletions
+4
View File
@@ -30,4 +30,8 @@ export class PseudoRandom {
nextFloat(min: number, max: number): number {
return this.next() * (max - min) + min;
}
nextID(): string {
return this.nextInt(0, 1000000).toString(36).padStart(5, '0');
}
}
-6
View File
@@ -1,11 +1,5 @@
import {Cell} from "./Game";
export function generateUniqueID(): string {
const array = new Uint8Array(16);
crypto.getRandomValues(array);
return Array.from(array, byte => byte.toString(16).padStart(2, '0')).join('');
}
export function manhattanDist(c1: Cell, c2: Cell): number {
return Math.abs(c1.x - c2.x) + Math.abs(c1.y - c2.y);
}