Created
November 15, 2022 12:30
-
-
Save potato4d/91795364a7c0b9c593811936d3596b65 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs/promises') | |
async function run() { | |
const rule = 'oretachi' | |
const file = await fs.readFile(`${__dirname}/../lflist.conf`, { encoding: 'utf-8' }) | |
const oretachi = file.split(`!${rule}`)[1].split("\n!")[0] | |
const [_, ...texts] = oretachi.split('#') | |
console.log(texts) | |
const forbidden = texts[0].split('\n').filter((_,n) => n).filter((c) => c).map((content) => content.split('--')[1]) | |
const limited = texts[1].split('\n').filter((_,n) => n).filter((c) => c).map((content) => content.split('--')[1]) | |
const semiLimited = texts[2].split('\n').filter((_,n) => n).filter((c) => c).map((content) => content.split('--')[1]) | |
const text = `${rule} リミットレギュレーション | |
## 禁止カード | |
- ${forbidden.join('\n- ')} | |
## 制限カード | |
- ${limited.join('\n- ')} | |
## 準制限カード | |
- ${semiLimited.join('\n- ')}` | |
await fs.writeFile('format.txt', text, { encoding: 'utf-8' }) | |
} | |
run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment