fix: Schocken - normale Zahlen absteigend als Zahl verglichen (621 > 554)
This commit is contained in:
@@ -61,7 +61,10 @@ function classifyDice(dice) {
|
|||||||
if (c-a===2 && b-a===1) return { type:'strasse', scheiben:2, label:`Straße ${a}-${b}-${c}!`, value: a };
|
if (c-a===2 && b-a===1) return { type:'strasse', scheiben:2, label:`Straße ${a}-${b}-${c}!`, value: a };
|
||||||
|
|
||||||
// Normale Zahl
|
// Normale Zahl
|
||||||
return { type:'normal', scheiben:1, label:'Normal', value: sorted.reduce((s,v)=>s+v,0) };
|
// Normale Zahlen: absteigend sortiert als dreistellige Zahl (z.B. 6-2-1 = 621, 5-5-4 = 554)
|
||||||
|
const desc = [...sorted].reverse(); // absteigend
|
||||||
|
const normalValue = desc[0]*100 + desc[1]*10 + desc[2];
|
||||||
|
return { type:'normal', scheiben:1, label:`${desc[0]}-${desc[1]}-${desc[2]}`, value: normalValue };
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wertungsvergleich: wer hat schlechtere Würfel (bekommt Scheiben)
|
// Wertungsvergleich: wer hat schlechtere Würfel (bekommt Scheiben)
|
||||||
|
|||||||
Reference in New Issue
Block a user