Skip to content

Instantly share code, notes, and snippets.

@nillpo
Created December 12, 2023 05:59
Show Gist options
  • Save nillpo/5b3ab01f37bffe24bdfa249c655407f2 to your computer and use it in GitHub Desktop.
Save nillpo/5b3ab01f37bffe24bdfa249c655407f2 to your computer and use it in GitHub Desktop.
function* meraGenerator() {
for (let i = 0x30A1; i <= 0x30FA; i++) {
yield `${String.fromCharCode(i)}メラ`;
}
}
console.log(
[...meraGenerator()].sort().reduce((p, c, index) => {
if (index % 10 === 0) {
p.push([c]);
} else {
p[p.length - 1].push(c);
}
return p;
}, [] as string[][]).map((s) => s.join(",")).join("\n"),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment