mirror of https://github.com/aldy505/asciitxt.git
178 lines
1.8 KiB
JavaScript
178 lines
1.8 KiB
JavaScript
/**
|
|
* A simple codegen to generate the array of array letter
|
|
*/
|
|
const fs = require('fs/promises');
|
|
|
|
const letters =
|
|
[
|
|
`
|
|
__ _
|
|
/ _\` |
|
|
| (_| |
|
|
\\__,_|
|
|
`,
|
|
` _
|
|
| |__
|
|
| '_ \\
|
|
| |_) |
|
|
|_.__/
|
|
`,
|
|
`
|
|
___
|
|
/ __|
|
|
| (__
|
|
\\___|
|
|
`,
|
|
` _
|
|
__| |
|
|
/ _ |
|
|
| (_| |
|
|
\\__,_|
|
|
`,
|
|
`
|
|
___
|
|
/ _ \\
|
|
| __/
|
|
\\___|
|
|
`,
|
|
` __
|
|
/ _|
|
|
| |_
|
|
| _|
|
|
|_|
|
|
`,
|
|
`
|
|
__ _
|
|
/ _\` |
|
|
| (_| |
|
|
\\__, |
|
|
|___/ `,
|
|
` _
|
|
| |__
|
|
| '_ \\
|
|
| | | |
|
|
|_| |_|
|
|
`,
|
|
` _
|
|
(_)
|
|
| |
|
|
| |
|
|
|_|
|
|
`,
|
|
` _
|
|
(_)
|
|
| |
|
|
| |
|
|
_/ |
|
|
|__/ `,
|
|
` _
|
|
| | __
|
|
| |/ /
|
|
| <
|
|
|_|\\_\\
|
|
`,
|
|
` _
|
|
| |
|
|
| |
|
|
| |
|
|
|_|
|
|
`,
|
|
`
|
|
_ __ ___
|
|
| '_ \` _ \\
|
|
| | | | | |
|
|
|_| |_| |_|
|
|
`,
|
|
`
|
|
_ __
|
|
| '_ \
|
|
| | | |
|
|
|_| |_|
|
|
`,
|
|
`
|
|
___
|
|
/ _ \
|
|
| (_) |
|
|
\___/
|
|
`,
|
|
`
|
|
_ __
|
|
| '_ \
|
|
| |_) |
|
|
| .__/
|
|
|_| `,
|
|
`
|
|
__ _
|
|
/ _\` |
|
|
| (_| |
|
|
\\__, |
|
|
|_|`,
|
|
`
|
|
_ __
|
|
| '__|
|
|
| |
|
|
|_|
|
|
`,
|
|
`
|
|
___
|
|
/ __|
|
|
\\__ \\
|
|
|___/
|
|
`,
|
|
` _
|
|
| |_
|
|
| __|
|
|
| |_
|
|
\\__|
|
|
`,
|
|
`
|
|
_ _
|
|
| | | |
|
|
| |_| |
|
|
\\__,_|
|
|
`,
|
|
`
|
|
__ __
|
|
\\ \\ / /
|
|
\\ V /
|
|
\\_/
|
|
`,
|
|
`
|
|
__ __
|
|
\\ \\ /\\ / /
|
|
\\ V V /
|
|
\\_/\\_/
|
|
`,
|
|
`
|
|
__ __
|
|
\\ \\/ /
|
|
> <
|
|
/_/\\_\\
|
|
`,
|
|
`
|
|
_ _
|
|
| | | |
|
|
| |_| |
|
|
\\__, |
|
|
|___/ `,
|
|
`
|
|
____
|
|
|_ /
|
|
/ /
|
|
/___|
|
|
`,
|
|
]
|
|
|
|
;(async () => {
|
|
let output = ''
|
|
for (const letter of letters) {
|
|
let split = letter.split('\n');
|
|
output += `case "":\n`
|
|
output += `return []string{\n`
|
|
for (const s of split) {
|
|
output += '`'+s+'`,\n'
|
|
}
|
|
output += "}\n";
|
|
}
|
|
await fs.writeFile('./../generated.go', output, { encoding: 'utf-8' });
|
|
})(); |