mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-01-04 04:17:33 +01:00
22 lines
428 B
TypeScript
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 "";
|
|
}
|