免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: flw
打印 上一主题 下一主题

【另类语言介绍】BrainFuck 语言 [复制链接]

论坛徽章:
0
71 [报告]
发表于 2007-06-23 09:15 |只看该作者
原帖由 nully 于 2007-6-22 18:30 发表

        http://compsoc.dur.ac.uk/whitespace/


这个是够变态的,Perl也有一个同样的模块Bleach,应用它会把你的正常程序变成一片空白。可以欺骗生手,打开源程序一看全是空白,结果还能运行!

论坛徽章:
0
72 [报告]
发表于 2008-06-01 21:03 |只看该作者
我觉得中文译名应该叫“脑残语言”

论坛徽章:
0
73 [报告]
发表于 2008-06-01 21:13 |只看该作者
原帖由 nostoryboy 于 2008-6-1 21:03 发表
我觉得中文译名应该叫“脑残语言”



这不太合适。 这个语言还是很有趣的,麻雀虽小,五脏俱全。

论坛徽章:
0
74 [报告]
发表于 2008-06-01 21:14 |只看该作者
The Language

A Brainfuck program has an implicit byte pointer, called "the pointer", which is free to move around within an array of 30000 bytes, initially all set to zero. The pointer itself is initialized to point to the beginning of this array.

The Brainfuck programming language consists of eight commands, each of which is represented as a single character.
>         Increment the pointer.
<         Decrement the pointer.
+         Increment the byte at the pointer.
-         Decrement the byte at the pointer.
.         Output the byte at the pointer.
,         Input a byte and store it in the byte at the pointer.
[         Jump forward past the matching ] if the byte at the pointer is zero.
]         Jump backward to the matching [ unless the byte at the pointer is zero.


The semantics of the Brainfuck commands can also be succinctly expressed in terms of C, as follows (assuming that p has been previously defined as a char*):
>         becomes         ++p;
<         becomes         --p;
+         becomes         ++*p;
-         becomes         --*p;
.         becomes         putchar(*p);
,         becomes         *p = getchar();
[         becomes         while (*p) {
]         becomes         }

论坛徽章:
0
75 [报告]
发表于 2010-05-25 13:13 |只看该作者
回复 1# flw


    LZ,这个应该叫解释器,不是编译器,代码中有一些多余的";"
另外这个解释器最好还是自己初始化一下,因为我本来想直接用的,不过一开始就是RANGE ERROR,呵

论坛徽章:
0
76 [报告]
发表于 2010-05-25 14:32 |只看该作者
貌似有点复杂

论坛徽章:
0
77 [报告]
发表于 2010-05-25 17:02 |只看该作者
Fuck语言??呵呵…………

论坛徽章:
2
程序设计版块每日发帖之星
日期:2015-06-17 22:20:00每日论坛发贴之星
日期:2015-06-17 22:20:00
78 [报告]
发表于 2010-05-25 21:13 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
79 [报告]
发表于 2010-05-25 23:33 |只看该作者
感觉像一步一个脚印
呵呵

论坛徽章:
0
80 [报告]
发表于 2010-05-26 10:05 |只看该作者
好强大的语言啊!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP