bitburner-src/src/Infiltration/utils.ts
2021-10-27 20:52:16 -04:00

22 lines
428 B
TypeScript

export function random(min: number, max: number): number {
return Math.random() * (max - min) + min;
}
export function getArrow(event: KeyboardEvent): string {
switch (event.key) {
case "ArrowUp":
case "w":
return "↑";
case "ArrowLeft":
case "a":
return "←";
case "ArrowDown":
case "s":
return "↓";
case "ArrowRight":
case "d":
return "→";
}
return "";
}