版本比较
Brainfuck语言基础
正文
增加 82 行删除 3 行
1234567891011121314151617181920212223242526272829303132333435363738394025 行未改动66676869343570717273747593 行未改动169170171172173174175176177138178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221# Brainfuck 语法:::info[官方解释]|符号|解释||:--:|:--||>|increment the data pointer (to point to the next cell to the right).|<|decrement the data pointer (to point to the next cell to the left).|+|increment (increase by one) the byte at the data pointer.|-|decrement (decrease by one) the byte at the data pointer.|.|output the byte at the data pointer.|,|accept one byte of input, storing its value in the byte at the data pointer.|[|if the byte at the data pointer is zero, then instead of moving the instruction pointer forward to the next command, jump it forward to the command after the matching ] command.|]|if the byte at the data pointer is nonzero, then instead of moving the instruction pointer forward to the next command, jump it back to the command after the matching [ command.|!|if the exclaim box is checked, allows the interpreter to use all characters to the right of the ! as program input.::::
::::info[洛谷翻译]
这种语言的运行机制十分简单,只有一个大小为 $30000$(作者解释:或许可以更大,也可以用无符号)的有符号 $8$ 位整数(范围 $[-128,127]$)的内存槽,和一个指向内存槽中位置的指针,在最初的时候指向内存槽的第一个整数。
这种语言的字符集也是十分的简单,只有`+ - , . > < []`。
|字符|意义||:-|:-||`<` |指针所指向的内存地址减一。||`>` |指针所指向的内存地址加一。||`+` |指针所指向的内存里面的数值加一。||`-` |指针所指向的内存里面的数值减一。||`.` |输出当前指针所指向的内存里面的数值(以字符形式输出)。||`,` |将读入缓冲区中的一个字节送入当前指针指向的内存里面。如果读入缓冲区为空则送入 $-1$。||`[` |当前指针指向的内存里面的数值不为 $0$ 时,重复执行与之相匹配的 `]` 之间的语句,直到回到 `[` 时当前指针指向的内存中的数值为 $0$。||`]` |如上。|
字符在内存中的数值为字符所对应的 ASCII 码。::::
# Brainfuck 入门
## 乘法
25 行未改动先分析第一行 `++++ ++++`:
第一轮循环:  
我们可以注意到,每一轮循环都会使第一个格子 $-1$,第二个格子 $+6$,知道第一格清零,第二格就变成了 $8\times6$。
93 行未改动## 引言请你熟背 ASCII 码表并且安装一个 Brainfuck 编译/解释器。
## NOT GATE::::info[题目]输入一个字符,请你判断是否有输入。也就是输入 $c$,计算 $!c$。::::
## 带余除法::::info情况一:|67|0|0|0|:--:|:--:|:--:|:--:|+|||
|67|1|0|0|:--:|:--:|:--:|:--:||+||
|67|0|0|0|:--:|:--:|:--:|:--:||+||
情况二:|0|0|0|0|:--:|:--:|:--:|:--:|+|||
|0|1|0|0|:--:|:--:|:--:|:--:||+||
|0|1|0|0|:--:|:--:|:--:|:--:||+||::::
::::success```,>[-]+< 加 1[>->] 如果不为 0,则减 1>[>>]<< 两种情况指针位置合并```::::
## 带余除法::::info[题目]给你 $cell #1$ 和 $cell #2$,请求出它们的商和余数。::::## 比较器
## BASE 64