fix rng stanze

This commit is contained in:
2026-07-02 15:08:38 +02:00
parent ced6daee20
commit efe2ef2a76

14
app.js
View File

@@ -741,18 +741,10 @@
let players = [];
let currentBet = null; // {roomId}
function prestige(roomId) {
const r = roomById[roomId];
return (r.jacuzzi ? 2 : 0) + (r.posti === 1 ? 1 : 0);
}
function buildRevealOrder() {
// svelati per prestigio crescente: le stanze con jacuzzi (jackpot) per ultime
const people = PARTICIPANTS.map((p) => p.nome);
return Matching.shuffle(people, Math.random).sort(
(a, b) =>
prestige(assignment.byPerson[a]) - prestige(assignment.byPerson[b]),
);
// ordine completamente casuale: ogni persona (e quindi ogni stanza, anche
// quelle con idromassaggio) può uscire in qualsiasi momento
return Matching.shuffle(PARTICIPANTS.map((p) => p.nome), Math.random);
}
function newGame(keepChips) {