Last active
January 5, 2025 13:59
-
-
Save taroyanaka/cee430794ea740e89b1d5965d1a0f8a3 to your computer and use it in GitHub Desktop.
YMM4の台本ファイル作るJSファイル名前を変えて適当に動かす。出力ファイルは.txt形式で
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
// Input multiline string | |
const input = `ボケです | |
ツッコミです | |
殴られ役です | |
ツッコミは暴力じゃねえから | |
ドカ、バキ、ボケは達した | |
マゾのボケなんかい!`; | |
// Process each line | |
const processed = input | |
.trim() // Remove leading/trailing empty lines | |
.replace(/「/g, '『') // Replace 「 with 『 | |
.replace(/」/g, '』') // Replace 」 with 』 | |
.split('\n') // Split into individual lines | |
.map((line, index) => (index % 2 === 0 ? `taro_zunda「${line}」` : `kami_himari「${line}」`)) // Add prefix based on line index | |
.join('\n'); // Join lines back into a single string | |
console.log(processed); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment