【JavaScript】10種類の文字とwindow,文字列'CogS'だけでHelloWorld（後編）

半年近く前に書かれた[前回][prev]のあらすじ。
[prev]:https://qiita.com/po_tau_feu/items/fb496ec78d0d6886a928


```javascript:HelloWorld3-2.js
const helloWorld = (function(w,cogs,v){
    v = [
        ([]+!+[])[+[]]+cogs[+!+[]]+cogs[!+[]+!+[]+!+[]]+([]+!+[])[+[]]+
                ([]+!+[])[+!+[]]+([![]]+[][+[]])[[+!+[]]+(+[])]+([]+[][
                +[]])[+!+[]]+cogs[!+[]+!+[]]
    ];
    v[+!+[]] = w[cogs[!+[]+!+[]+!+[]]+(+([!+[]+!+[]+!+[]+!+[]]+[!+[]+!+
            []+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]
			+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!
			+[]+!+[]+!+[]]+[!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!
			+[]]+[!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!
			+[]+!+[]]))[v[+[]]](([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+
			!+[]+!+[]]))][(+([!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]
			+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]
			+!+[]+!+[]+!+[]]+[+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[
			]+!+[]]))[v[+[]]](+([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!
			+[]+!+[]]))+cogs[+[]]+(+([!+[]+!+[]]+[!+[]+!+[]]+[!+[]+!+[]
			+!+[]+!+[]]+[+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[
			]+!+[]]))[v[+[]]](+([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!
			+[]+!+[]]))+cogs[+[]]+(+([!+[]+!+[]+!+[]]+[+!+[]]+[!+[]+!+[
			]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]
			+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))[v[+[]]](+([!+[]+!+[]+!+[
			]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))];
    return function(){
        w['console']['log']('Hello, World!');
    }
})(window,'CogS');
```

v[0]で`'toString'`、v[1]で`String.fromCharCode`を使えるようになりました。
あとは`'console'`、`'log'`、`'Hello, World!'`の文字列を用意できれば勝ちです。

# 4. 最後の仕上げ

# 4.1. 文字列の準備
`String.fromCharCode`が使えるので、もう文字列なんて怖くありません。
ぱぱっと用意してあげましょう。

```js
//(27612545666)['toString'](36) // 'console'
(+([!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[+!+[]]+[!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))[v[+[]]](+([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]));
//(28096)['toString'](36) // 'log'
(+([!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))[v[+[]]](+([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]));
// 'Hello, World!'
/* 'H'    */   v[+!+[]](+([!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]]))
/* 'ello' */ + (+([!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[+!+[]]+[+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[+[]]))[v[+[]]](+([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))
/* ','    */ + v[+!+[]](+([!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]]))
/* ' '    */ + v[+!+[]](+([!+[]+!+[]+!+[]]+[!+[]+!+[]]))
/* 'W'    */ + v[+!+[]](+([!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))
/* 'orld' */ + (+([+!+[]]+[+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]]+[+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]]))[v[+[]]](+([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))
/* '!'    */ + v[+!+[]](+([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]]));
```

これらをしかるべき場所に置くと、

```js:HelloWorld4-1.js
const helloWorld = (function(w,cogs,v){
    v = [
        ([]+!+[])[+[]]+cogs[+!+[]]+cogs[!+[]+!+[]+!+[]]+([]+!+[])[+[]]+
                ([]+!+[])[+!+[]]+([![]]+[][+[]])[[+!+[]]+(+[])]+([]+[][
                +[]])[+!+[]]+cogs[!+[]+!+[]]
    ];
    v[+!+[]] = w[cogs[!+[]+!+[]+!+[]]+(+([!+[]+!+[]+!+[]+!+[]]+[!+[]+!+
            []+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]
            +!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!
            +[]+!+[]+!+[]]+[!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!
            +[]]+[!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!
            +[]+!+[]]))[v[+[]]](([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+
            !+[]+!+[]]))][(+([!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]
            +!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]
            +!+[]+!+[]+!+[]]+[+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[
            ]+!+[]]))[v[+[]]](+([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!
            +[]+!+[]]))+cogs[+[]]+(+([!+[]+!+[]]+[!+[]+!+[]]+[!+[]+!+[]
            +!+[]+!+[]]+[+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[
            ]+!+[]]))[v[+[]]](+([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!
            +[]+!+[]]))+cogs[+[]]+(+([!+[]+!+[]+!+[]]+[+!+[]]+[!+[]+!+[
            ]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]
            +[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))[v[+[]]](+([!+[]+!+[]+!+[
            ]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))];
    return function(){
        w[
            (+([!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!
            +[]+!+[]+!+[]+!+[]+!+[]]+[+!+[]]+[!+[]+!+[]]+[!+[]+!+[]+!+[
            ]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[
            ]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[
            ]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))[v[+[]]](+([!+[]+!
            +[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))
        ][
            (+([!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[+
            []]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+
            []+!+[]+!+[]+!+[]+!+[]]))[v[+[]]](+([!+[]+!+[]+!+[]]+[!+[]+
            !+[]+!+[]+!+[]+!+[]+!+[]]))
        ](
            v[+!+[]](+([!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]]
            ))+(+([!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+
            !+[]+!+[]+!+[]+!+[]]+[+!+[]]+[+!+[]]+[!+[]+!+[]+!+[]+!+[]+!
            +[]+!+[]+!+[]+!+[]]+[+[]]))[v[+[]]](+([!+[]+!+[]+!+[]]+[!+[
            ]+!+[]+!+[]+!+[]+!+[]+!+[]]))+v[+!+[]](+([!+[]+!+[]+!+[]+!+
            []]+[!+[]+!+[]+!+[]+!+[]]))+v[+!+[]](+([!+[]+!+[]+!+[]]+[!+
            []+!+[]]))+v[+!+[]](+([!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!
            +[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))+(+([+!+[]]+[+!+
            []]+[!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]]+[
            !+[]+!+[]+!+[]+!+[]+!+[]]+[+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]])
            )[v[+[]]](+([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]
            ]))+v[+!+[]](+([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]]))
        );
    }
})(window,'CogS');
```
こうです。
考えずに感じてください。

## 4.2. `function`,`return`,`;`,`{}`の置き換え

これらは割と単純な置き換えです。
以下の要領で置換してみましょう。

|置き換え前|置き換え後|
|---|---|
|`function(...args)`|`(...args)=>`|
|`return`||
|`;`|`,` (`return`の後のみ除去)|
|`{`, `}`|`(`, `)`|

今回は都合よく`;`を忘れていたりもしていますが、
`return`の後の`;`は`,`にせず除去しましょう。
`()`を足したりする必要がある場合もあるかもしれません。

冗長になるのでソースコードは貼りません。

## 4.3. 変数名の除去

変数名に使える文字は`_`だけなので、
`w`,`cogs`,`v`をそれぞれ`___`,`__`,`_`に置き換えましょう。
置き換えたものがこちらです。

```js:HelloWorld4-2.js
const helloWorld = ((___,__,_)=>(
    _ = [
        ([]+!+[])[+[]]+__[+!+[]]+__[!+[]+!+[]+!+[]]+([]+!+[])[+[]]+
                ([]+!+[])[+!+[]]+([![]]+[][+[]])[[+!+[]]+(+[])]+([]+[][
                +[]])[+!+[]]+__[!+[]+!+[]]
    ],
    _[+!+[]] = ___[__[!+[]+!+[]+!+[]]+(+([!+[]+!+[]+!+[]+!+[]]+[!+[]+!+
            []+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]
            +!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!
            +[]+!+[]+!+[]]+[!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!
            +[]]+[!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!
            +[]+!+[]]))[_[+[]]](([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+
            !+[]+!+[]]))][(+([!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]
            +!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]
            +!+[]+!+[]+!+[]]+[+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[
            ]+!+[]]))[_[+[]]](+([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!
            +[]+!+[]]))+__[+[]]+(+([!+[]+!+[]]+[!+[]+!+[]]+[!+[]+!+[]
            +!+[]+!+[]]+[+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[
            ]+!+[]]))[_[+[]]](+([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!
            +[]+!+[]]))+__[+[]]+(+([!+[]+!+[]+!+[]]+[+!+[]]+[!+[]+!+[
            ]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]
            +[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))[_[+[]]](+([!+[]+!+[]+!+[
            ]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))],
    ()=>(
        ___[
            (+([!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!
            +[]+!+[]+!+[]+!+[]+!+[]]+[+!+[]]+[!+[]+!+[]]+[!+[]+!+[]+!+[
            ]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[
            ]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[
            ]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))[_[+[]]](+([!+[]+!
            +[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))
        ][
            (+([!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[+
            []]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+
            []+!+[]+!+[]+!+[]+!+[]]))[_[+[]]](+([!+[]+!+[]+!+[]]+[!+[]+
            !+[]+!+[]+!+[]+!+[]+!+[]]))
        ](
            _[+!+[]](+([!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]]
            ))+(+([!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+
            !+[]+!+[]+!+[]+!+[]]+[+!+[]]+[+!+[]]+[!+[]+!+[]+!+[]+!+[]+!
            +[]+!+[]+!+[]+!+[]]+[+[]]))[_[+[]]](+([!+[]+!+[]+!+[]]+[!+[
            ]+!+[]+!+[]+!+[]+!+[]+!+[]]))+_[+!+[]](+([!+[]+!+[]+!+[]+!+
            []]+[!+[]+!+[]+!+[]+!+[]]))+_[+!+[]](+([!+[]+!+[]+!+[]]+[!+
            []+!+[]]))+_[+!+[]](+([!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!
            +[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))+(+([+!+[]]+[+!+
            []]+[!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]]+[
            !+[]+!+[]+!+[]+!+[]+!+[]]+[+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]])
            )[_[+[]]](+([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]
            ]))+_[+!+[]](+([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]]))
        )
    )
))(window,'CogS');
```

## 4.4. 空白文字の除去
あとはスペースや改行を除去すれば完成です。

```js:HelloWorld4-3.js
const helloWorld = ((___,__,_)=>(_=[([]+!+[])[+[]]+__[+!+[]]+__[!+[]+!+[]+!+[]]+([]+!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[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]]+[+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]]))[_[+[]]](+([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))+_[+!+[]](+([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]]))))))(window,'CogS');
```

見れたもんじゃないので適当に改行したものがこちらです。

```js:HelloWorld4-4.js
const helloWorld
=((___,__,_)=>(_=[([]+!+[])[+[]]+__[+!+[]]+__[!+[]+!+[]+!+[]]+([]+!+[])
[+[]]+([]+!+[])[+!+[]]+([![]]+[][+[]])[[+!+[]]+(+[])]+([]+[][+[]])[+!+[
]]+__[!+[]+!+[]]],_[+!+[]]=___[__[!+[]+!+[]+!+[]]+(+([!+[]+!+[]+!+[]+!+
[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]
+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[
]]+[!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[
]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))[_[+[]]](([!+[]+!+[]+!+[]
]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))][(+([!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+
!+[]]+[!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+
!+[]+!+[]+!+[]]+[+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))[_[+
[]]](+([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))+__[+[]]+(+([!
+[]+!+[]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[]+!+[]]+[+!+[]]+
[+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[+[]]))[_[+[]]](+([!+
[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]))+_[+!+[]](+([!+[]+!+[]+!
+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]]))+_[+!+[]](+([!+[]+!+[]+!+[]]+[!+[]+!+[
]]))+_[+!+[]](+([!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+
[]+!+[]+!+[]+!+[]+!+[]]))+(+([+!+[]]+[+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]]
+[!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]]+[+[]]+[!+[]+!+[]
+!+[]+!+[]+!+[]]))[_[+[]]](+([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]
+!+[]]))+_[+!+[]](+([!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]]))))))
(window,'CogS');
```

見れたもんじゃないですね。
ソースコードにこんなのが書いてあったら
見ようと思った人をげんなりさせること間違いなしです。

ともあれこれで当初の目的は達成されました。


# 5. 最後に

ところで、なんでこんなことしてたんでしたっけ？

そう、難読化です。
最初のモチベーションは難読化だったのでタグもつけてはいますが、
実は難読化としての効果は多分薄いです。

というのも、ソースコードの大部分を占めるのが数字の記述なわけですが、
今回は自前の関数で雑に出力しているせいで、デコードが割と簡単にできます。

なので、ソースを見たい人をげんなりさせる程度の効果はありますが、
中身を隠す能力はそこまで高くありません。
こんなに手間かけて難読化してる暇があったら、
別のことをしたほうが有意義だと思います。


あと、ホントは`'CogS'`という文字列になぞらえて、
インデントを入れて歯車状に並べるプログラムを作っていたのですが、
完全に忘却していてこのままだと完成しない気がしたので
諦めて後編を投稿しました。

半年近くお待たせして申し訳ありませんでした。

それではまた。
しばらくはこんな重いネタ書きません。