Looping characters used.

This commit is contained in:
mike12345567 2024-02-26 18:29:57 +00:00
parent 80dc0beeed
commit 59ab557a93
1 changed files with 7 additions and 1 deletions

View File

@ -28,7 +28,13 @@ export default class AliasTables {
const char = this.character
this.aliases[tableName] = char
this.tableAliases[char] = tableName
this.character = String.fromCharCode(char.charCodeAt(0) + 1)
this.character =
char.substring(0, char.length - 1) +
String.fromCharCode(char.charCodeAt(char.length - 1) + 1)
// reached end of characters, extend number of characters used
if (this.character === "z") {
this.character = new Array(this.character.length + 1).fill("a").join("")
}
return char
}