Wip : adventure mode

This commit is contained in:
Renan LE CARO 2025-03-26 14:04:54 +01:00
parent 395968bc52
commit 6cf8fabf16
14 changed files with 457 additions and 114 deletions

View file

@ -14,7 +14,7 @@ export function sample<T>(arr: T[]): T {
return arr[Math.floor(arr.length * Math.random())];
}
export function sumOfKeys(obj: { [key: string]: number } | undefined | null) {
export function sumOfValues(obj: { [key: string]: number } | undefined | null) {
if (!obj) return 0;
return Object.values(obj)?.reduce((a, b) => a + b, 0) || 0;
}