一个互动的脑力翻译
ibf的Python项目详细描述
互动大脑
一个用bython写的互动式大脑翻译。为什么不?
要从源代码安装,必须首先将bython源代码构建到python包中:
$ make build
然后,移动到python
文件夹,并运行安装脚本:
$ cd python
$ sudo -H pip3 install .
安装后,使用ibf
命令运行交互式会话:
$ ibf
Interactive BrainFuck - ibf v0.1
ibf is licensed under the permissive MIT license. Full license and
copyright information is available at the project's GitHub repository.
[Input] +[------->++<]>-.------------.--[--->+<]>--.+.+++[->+++<]>.+++++++++++++.[-->+++++<]>+++.[-->+++++++<]>.++.---.------------.-[--->+<]>----.+++[->+++<]>++.--[--->+<]>--.+.-----------.+++++.-------------.--[--->+<]>-.-----.+++.>++++++++++.
master procrastinator
你输入的所有东西都被解释为脑残代码,除了以下 保留关键字:
Command | Description |
---|---|
tape | Prints the current status of the tape (data cells), with the current cell in bold |
pos | Prints the current position on the tape |
quit | Quits the session |
run <file> | Run code from a file |
你也可以运行预先编写好的大脑操代码,或者作为一个独立的程序,或者 在交互式会话中:
$ ibf test.bf
Hello World!
$ ibf
Interactive BrainFuck - ibf v0.1
ibf is licensed under the permissive MIT license. Full license and
copyright information is available at the project's GitHub repository.
[Input] run test.bf
Hello World!
run
命令始终运行程序inline,即代码在
当前磁带和当前磁带位置作为起始位置。因此,
运行程序后,您可以检查磁带的最终状态:
[Input] tape
0 1 2 3 4 5 6 7 8
0 0 72 100 87 33 10 0 0
有关更多帮助,请键入ibf -h
,或通过运行man ibf
查看手册页。