Il viale alberato della Provinciale e la Carza verso La Luna; la mappa si cerca scrivendo

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ApqNBvNbNCwXqR2RLo8QJh
This commit is contained in:
2026-10-24 18:47:01 +02:00
co-authored by Claude Opus 5.5
parent d89092303a
commit 3e99fb094c
22 changed files with 155 additions and 26 deletions
+8
View File
@@ -50,6 +50,14 @@ export function shuffledCredits(credits, random = Math.random) {
});
}
// La ricerca della mappa: ogni parola scritta deve stare nel nome del posto, senza badare a maiuscole, accenti e
// apostrofi («camp» trova Campomigliaio, «de medici» trova Via de' Medici).
const plain = text => text.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, '').replace(/[^a-z0-9]+/g, ' ').trim();
export function matchPlace(name, query) {
const words = plain(query).split(' ').filter(Boolean), hay = plain(name);
return words.every(w => hay.includes(w));
}
export const sayTime = text => Math.max(1.6, 0.9 + text.length * 0.055);
export function newState(story) {