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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user