Skip to content

mapan1984/JsBrainFuck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

BrainFuck Interpreter

BrainFuck语法

语言由 8 种符号组成,含义如下:

> 指针向右移动一格
< 指针向左移动一格
+ 使指针当前格数值加一
- 使指针当前格数值减一
[ 当指针当前指向值为 0 时,程序跳转到与之对应的 ] 之后;否则程序正常向下执行
] 程序跳转回与之对应的 [ 处(如果指针当前指向值为 0 是,跳转到 ] 之后)
. 把当前指针指向格中的值按 ASCII 表输出到终端
, 从终端读取 1 byte 的数据,存储其 ASCII 值到当前格

BrainFuck示例

用BrainFuck写的hello world程序:

++++++++++
[
    >+++++++
    >++++++++++
    >+++
    >+
    <<<<-
]
>++.
>+.
+++++++..
+++.
>++.
<<+++++++++++++++.
>.
+++.
------.
--------.
>+.
>.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors