OHHHH,brainfuck自产生程序!
brainf 自产生程序 quine: 输出自身源代码
by DGCK81LNN
声明部分:将输出部分的源代码存在内存中
>>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
( 0 0 0 输 出 部 分 源 代 '码 )(' = 指针)
以下都是输出部分。
①获得大于号和加号
>>>>++++[-<++++[-<++++>]>] 4*4*4=64
>+++[-<+++[-<+++++>]>] 5*3*3=45
<<--<-- 分别减2
( 0 0 0 输 出 部 分 源 代 码 0 '62 43 )
②根据声明部分存储的数据,反推并输出声明部分的源代码
.. 输出两个大于号
<<[<] 指针回到字符串首
( 0 0 '0 输 出 部 分 源 代 码 0 62 43 )
>[
内存中的输出部分源代码在此循环中将被整体左移2个单元格:
从第一个字节开始一个一个字节移动,
一次只移1,随后立刻输出加号,直到原位置的值为0为止,
原位置和目标位置之间会始终有一个0,方便定位,我把这个0称为“假指针”。
[>]>. 指针移到大于号62处,输出一个大于号
( 0 0 "0 输 出 部 分 源 代 码 0 '62 43 )(第一次循环)(" = 假指针)
( 0 输 0 "0 出 部 分 源 代 码 0 '62 43 )(第二次循环)
<<[<]> 指针回到假指针右手边第一个单元格
( 0 0 "0 '输 出 部 分 源 代 码 0 62 43 )
( 0 输 0 "0 '出 部 分 源 代 码 0 62 43 )
开始移动字节和输出加号
[
-<<+ 当前单元格减1,左手边第二个单元格加1
>>>[>]>>. 指针移到加号43处输出加号
( … 0 62 '43 )
<<<[<]<[>]> 指针回到假指针右手边第一个单元格
]
( 0 输 "0 '0 出 部 分 源 代 码 0 62 43 )
( 0 输 出 "0 '0 部 分 源 代 码 0 62 43 )
>]
( 0 输 出 部 分 源 代 码 0 0 '0 62 43 )
③最后直接输出声明部分存储的数据,即输出部分的源代码
<<<[<] 指针回到字符串首
>[
. 输出整个字符串
>]
无注释版本(同时也是输出):
>>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>>>++++[-<++++[-<++++>]>]>+++[-<+++[-<+++++>]>]<<--<--..<<[<]>[[>]>.<<[<]>[-<<+>>>[>]>>.<<<[<]<[>]>]>]<<<[<]>[.>]
在编写以上代码时用到了以下程序来生成声明部分第二行的代码。
原理与输出部分的②雷同,就不加太多注释了。
获得大于号和加号
>>>>++++[-<++++[-<++++>]>]
>+++[-<+++[-<+++++>]>]
<<--<--
( '62 43 )
读取输入的每一个字符。对于每个字符,先输出一个大于号,随后再输出字符编码个加号。
>>
,[
( 62 43 '刚刚输入的字符 )
<<.>>
[
-<.>
]
,]
我的brainfuck在线调试器基本完成了! https://dgck81lnn.github.io/apps/lab/brainfuck.html
更新
又写了个更短些的版本。
视觉上似乎没什么区别,不过这次声明部分那行长长的>+++++++++++++
至少缩减掉了90%)
本来这行代码存储的是输出部分源代码的ASCII,这次改成了存储1-8的数,分别代表可能出现的八种字符(enum?)
虽然新版程序体积更小,但上面的原版似乎更易于理解一些(
新版quine!
【声明部分】
>>> 先留几个空格
然后存储输出部分的代码。每个格存一个1到8的数,1到8分别代表加号、逗号、减号、点、小于号、大于号、左方括号、右方括号。
>++++++>++++++>++++++>+>+>+>+++++++>+++>+++++>+>+>+>+++++++>+++>+++++>+>+>+>+>+>++++++>++++++++>++++++>++++++++>+++++>+++++>+++++++>+++>++++++>+>++++++>+>++++++>+>++++++>+>+++++>+++++>+++++>+++++>++++++++>++++++>+++>+++>++++++>+++>++++++>++++++>+>++++++>++++++>++++++>++++++>++++++>+>+>+>+>+++++++>+++>+++++>+>+>+>+>+++++++>+++>+++++>+>+>+>+>++++++>++++++++>++++++>++++++++>+++++>+++++>+++++++>+++>+++++>+>+++++>+>++++++>++++++>++++++++>+++++>+++>+++>+++++>+++>+++>+++>+++>++++++>++++++>++++++>++++++>++++++>++++++>+>+>+>+++++++>+++>+++++>+>+>+>+>+>+++++++>+++>+++++>+>+>+>+>+>+>++++++>++++++++>++++++>++++++++>+++++>+++++>+++++++>+++>+++++>+>+++++>+>++++++>++++++>++++++++>+++++>+>+>+>+++++>+>+++++>++++>++++>++++>+++++++>+++++>++++++++>+++++>+++++>+++++++>+++++>++++++++>++++++>+++++++>+++++++>++++++>++++++++>++++++>++++++>++++++>++++++>++++++>++++++>++++>+++++++>+++++>++++++++>+++++>+++++++>+++++>++++++++>++++++>+++++++>+++>+++++>+++++>+>++++++>++++++>++++++>+++++++>++++++>++++++++>++++++>++++>+++++>+++++>+++++++>+++++>++++++++>+++++>+++++++>++++++>++++++++>++++++>++++++++>++++++>++++++++>+++++>+++++>+++++>+++++++>+++++>++++++++>++++++>+++++++>+++++>+++++>+>++++++>++++++>+++++++>+++>++++++>+++++++>++++++>++++++++>++++++>++++++>++++++>++++++>++++++>++++++>++++++>++++++>++++++>++++++>+++++++>+++++>++++++++>++++++>+++++++>+++>+++++>+>++++++>++++++++>+++++>+++++++>+++++>++++++++>+++++>+++++>+++++++>+++++>++++++++>+++++>+++++++>++++++>++++++++>++++++>++++++++>++++++>+++++++>++++++>++++++++>++++++>++++++>+++++++>++++++>++++++++>+++++>++++>+++++++>+++++++>+++>++++++>+>+++++>++++++++>+++++>++++++++>+++++>+++++>+++++>+++++++>+++++>++++++++>++++++>++++++++
【输出部分】
获得八个常数,分别是加号43、逗号44、减号45、点46、小于号60、大于号62、左方括号91、右方括号93
>>>+++[-<+++[-<+++++>]>] 5*3*3=45
<<[->+>+>+>+<<<<] 复制四份
>-->->>+ 上下微调得到43 44 45 46
>>>>>++++[-<++++[-<++++>]>] 4*4*4=64
<<[-<+<+>>] 复制两份
<--<---- 向下微调得到60 62
>>>>>>+++[-<+++++[-<++++++>]>] 6*5*3=90
<<[-<+<+>>] 复制两份
<+++<+ 向上微调得到91 93
( 0 0 0 0 f o o b a r 0 43 44 45 46 60 62 '91 93 )
<... 输出三个大于号
[<]<<[<] 指针回到数据左端
( 0 0 0 '0 f o o b a r 0 43 44 45 46 60 62 91 93 )
根据存储的数据反推并输出声明部分的源代码
>[ 遍历存储的数据。在此过程中,数据被整体左移2个单元格
[>]>>>>>>. 指针移到大于号处,输出个1大于号
( 0 0 0 "0 f o o b a r 0 43 44 45 46 60 '62 91 93 )(第一次循环)(" = 假指针)
( 0 0 f 0 "0 o o b a r 0 43 44 45 46 60 '62 91 93 )(第一次循环)
[<]<[<]> 指针回到正在遍历的数据处
( 0 0 0 "0 'f o o b a r 0 43 44 45 46 60 62 91 93 )
( 0 0 f 0 "0 'o o b a r 0 43 44 45 46 60 62 91 93 )
[ 将当前单元格的数据左移2个单元格,并输出数据值个加号
-<<+ 移1
>>>[>]>. 指针移到加号处,输出1个加号
<<[<]<[>]> 指针回到正在遍历的数据处
]
( 0 0 f "0 '0 o o b a r 0 43 44 45 46 60 62 91 93 )
( 0 0 f o "0 '0 o b a r 0 43 44 45 46 60 62 91 93 )
>]
( 0 0 f o o b a r 0 0 '0 43 44 45 46 60 62 91 93 )
最后解码并输出存储的数据,即输出部分的源代码
<<<[<] 指针回到数据左端
( 0 '0 f o o b a r 0 0 0 43 44 45 46 60 62 91 93 )
假设数据foobar的前三格是6 1 1:
( 0 '0 6 1 1 b a r 0 0 0 43 44 45 46 60 62 91 93 )
>[ 遍历存储的数据。遍历到的数据使用后将被削除
<<+>> 剩余数据左手边第二个单元格存1,用于定位
( 1 0 '6 1 1 b a r 0 0 "0 43 44 45 46 60 62 91 93 )
( 1 1 0 '1 1 b a r 0 0 "0 43 44 45 46 60 62 91 93 )
[- 将之前计算好的八个常数中的前(数据值)个左移1个单元格
>[>]>>>>>>>>>>[<]> 指针移到八个常数中最左边一个未左移的数处
[-<+>] 左移一个数
<[<]<<[<]<[>]> 指针回到正在遍历的数据处
]
( 1 0 '0 1 1 b a r 0 0 43 44 45 46 60 62 "0 91 93 )
( 1 1 0 '1 1 b a r 0 0 43 "0 44 45 46 60 62 91 93 )
>[>]>>[>]<. 找到并输出八个常数中最后左移的那个
( 1 0 0 1 1 b a r 0 0 43 44 45 46 60 '62 "0 91 93 )
( 1 1 0 '1 1 b a r 0 0 '43 "0 44 45 46 60 62 91 93 )
[ 从右往左遍历刚才左移的常数,把它们移回去
[->+<] 右移一个数
<]
( 1 0 0 1 1 b a r 0 0 '0 43 44 45 46 60 62 91 93 )
( 1 1 0 0 1 b a r 0 0 '0 43 44 45 46 60 62 91 93 )
<<<[<] 指针回到正在遍历的数据处
( 1 0 '0 1 1 b a r 0 0 0 43 44 45 46 60 62 91 93 )
( 1 1 0 '0 1 b a r 0 0 0 43 44 45 46 60 62 91 93 )
>]
( 1 1 1 1 1 1 1 0 '0 0 0 43 44 45 46 60 62 91 93 )