'"" "" "'" "'" "" "" "'" "" '"" "" ""' "" '""' "" "'" "" "" "" "" "'" "" "" "" "" "" "" "" "" "" "" "" "" '"" "" "" "" "" "" "" "" "" ""' "" "" "" "" '"" "" "" ""' "" "" "" "" '"" "" "" ""' "" "" "" "" '"" """ "" "" "" "" "" "" '"" "" "" "" "" "" "" "" "" "" "" "" "'" "" "" "" "" '"" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" " "" "" "" "" "" "" '"" "" "" "" "" "" "" "" "" "" "" "" "'" "" """" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "'" "" "" ""' '" "" "" "" "" "" "" "" "" "" "" "" "" '"" "" "" "" "" "" "" ""' "" "" "" " "" "" "" "" "" '"" "" "" "" "" "" "" "" "'" "" "" "" "'" "" "" """'" "" "" "" "" "" "" "" "'" "" "" "" "'" "" "" "" "" "" "" "" "'" "" "" "" "" "" "" "" "" '"" "" "" "" "" "" "" "" "" "" "" "" "'" "" "" "" "" '"" "" "" ""' "" "" "" "" '"" "" "" ""' "" "" "" "" '"" "" "" ""'"" "" "" "" "" "" "" "" "" "" "" "" "'" "" "" ""' "" "" "" "" "" "" "" "" "" "" "" "" "'" "" "" "" "" "" "" "" "" "" "" "" "'" "" '"" "" "" " "" '"" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "'" "" """" "" "" "" "" '"" "'" "" "" "" "" '"" "" "" "" "" "" "" "" "" "" "" " "" "" "" "" "" "" '"" "" "" ""' "" "" "" "" "" "" "" "" "" "" "" "" "" "'" "" "" "" "" "" "'" "" "" "" "" "" "" "" "" "" "" "" "" '"" """" "" "" "" "" "" '"" "" "" "" "" "'" "" "" "" "'" "" "" "'" "" '"" " "" "" "" "" "" "" "" '"" "" "" "" "" "" "" "" "" "" "" "" "'" "" "" "" "" '"" "" "" "'" "" "" "" "" "" "" "" "" "" "'" ""' "" "" "" "" '"" """ "" "" "" "" "" "" '"" "" "" "" "" "" "" "" "" "" "" "" "'" "" "" "" "" '"" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" " "" "'" "" "" "" "" "" "" "" "" ""' "" "'" "" "" "" "" "" "" "" ""'"" "" "" ""' "" "" "" "" "" "" "" "" '"" "" "" "" "" ""' "" "" "" '"" "'" "" "" "" "" "" "" "" "" "" "" "" ""' "" "" "" "" "" "" "" "" "" "' "" "" "" "" "" "" "" "'" ""' "" "" "" "" '"" "" "" ""' "" "" "" ""'" "" "" "" "" "" "" "" "" "" "" "" ""' "" "" "" "'" ""' "" "" "" "" " '"" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" " "" "" "" "" "" "" "" "" "" "" "" "" '"" "'" "" '"" "'" "" '"" "'"" "'" "" "" ""' "" "'" ""' "" "'" "" "" "" "" "" "'" "'" "'" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "'" "'" "" '"'" "" "" "" '"" "" "' "" "" "" "" "'" "'" "" '"" "" "" "" ""' "" '"" "'" "" "'"' "" "" """ '""' "" '"" "'" "" "" "'" "'" "" '"" "" "" "'" ""
説明
このプログラムは、次のような擬似コードと同等です。
while (cp = (ch = read)) + 1 {
(
(cp -= 65) ? // A
(cp -= 4) ? // E
(cp -= 4) ? // I
(cp -= 6) ? // O
(cp -= 6) ? // U
(cp -= 12) ? // a
(cp -= 4) ? // e
(cp -= 4) ? // i
(cp -= 6) ? // o
(cp - 6) ? // u
0
: 1
: 1
: 1
: 1
: 1
: 1
: 1
: 1
: 1
: 1
) ? ((--vs)+4) ? print(ch) : (++vs) : {
print(ch)
vs = 0
}
}
次の変数割り当てを使用します。
0 (unused) (13 bytes)
1 cp ( 4 bytes; occurs 20× in the code)
2 vs ( 7 bytes; occurs 5× in the code)
3 ch (10 bytes; occurs 3× in the code)
ご覧のとおり0
、書き込みが非常に長いため、可変スロット0 は避けました。
各文字を読み、両方に値を格納し、私たちはそうcp
とch
。変更しますcp
がch
、必要に応じて印刷できるように維持します。数字65、4、4、6などを連続して減算してcp
、ASCIIの10個の母音文字のそれぞれであるかどうかを確認します(最後の文字は割り当てである必要はありません)。
vs
常に印刷できる母音の数よりも3少ない数が常に含まれます。で始まる0
ため、3つの母音を印刷できます。に達すると-3
、母音の印刷を停止します。
(母音を含む)非母音に遭遇した場合、を実行print(ch)
しvs = 0
ます。おそらくご想像のとおり、これにより母音カウンターがリセットされます。
母音に出会ったら、実行し((--vs)+4) ? print(ch) : (++vs)
ます。これを分解しましょう:
- デクリメント
vs
;
- 値がnowの場合、
-4
行き過ぎているので、何も出力せずに、母音の出力を拒否し続けるようにvs
戻ります。-3
- それ以外の場合は、文字を印刷します。
aaYYAAaaaAERGH
。