Ceremonial PR: fix map gen #39

Merged
pyrex merged 14 commits from fix-mapgen into main 2025-02-23 05:41:20 +00:00
Showing only changes of commit 764d1e4892 - Show all commits

View File

@ -110,14 +110,17 @@ class Knife {
} else { } else {
errors.push(`${loc} is region ${r}, not found in merged`) errors.push(`${loc} is region ${r}, not found in merged`)
} }
if (r < 0) {
return "!";
}
// 0...9 and lowercase // 0...9 and lowercase
if (r < 36) { if (r < 36) {
return r.toString(36) return r.toString(36);
} }
// uppercase // uppercase
r -= 26; r -= 26;
if (r < 36) { if (r < 36) {
return r.toString(36).toUpperCase() return r.toString(36).toUpperCase();
} }
// Greek lowercase // Greek lowercase
r -= 36; r -= 36;
@ -134,12 +137,12 @@ class Knife {
return String.fromCodePoint(r + 0x3a3); return String.fromCodePoint(r + 0x3a3);
} }
// Hebrew // Hebrew
r -= 7 r -= 7;
if (r < 27) { if (r < 27) {
return String.fromCodePoint(r+0x5d0); return String.fromCodePoint(r+0x5d0);
} }
// give up // give up
return "?" return "?";
} }
return "."; // room without region return "."; // room without region
})(); })();