字符打印程序运行不正常
我一直在制作一个程序,将给定字符之前的每个字符输出到屏幕上,但是......我一直在用 Brainfuck 做这件事! :)
我希望能够输入一个字符,并查看它前面的所有字符。到目前为止,我的代码仅输出一个空格,然后等待下一个按键再退出。
++++++++
[>+++++++++<-]>.>++++++++++[>++++++++++<-]>+.+++++++..+++.>
++++++++[>++++<-]>.>++++++++[>++++++++++++<-]>+.+++ ++++++++++.
----------.>++++++++[>++++<-]>.>++++++++++
[>++++++++<-]>+++++++.
++++++++++++++.>+++++++++[>++++++++++++<-]>.---------.>
++++++++++[>+++++++++++<-]>+.--.--------.>+++
[>++++++++++<-]>+++.>++++++++++
..>+[,[>+>+<<-][>>-<<+>>]>[[-.]<]],
我多年来一直试图找出这段代码有什么问题,但我所做的一切都把它搞砸了。
I have been making a program that outputs each character before a given one to the screen, but... I've been doing it with Brainfuck! :)
I would like to be able to input a character, and see all the characters that come before it. The code I have so far only outputs a space and then waits for the next key press before exiting.
++++++++
[>+++++++++<-]>.>++++++++++[>++++++++++<-]>+.+++++++..+++.>
++++++++[>++++<-]>.>++++++++[>++++++++++++<-]>+.+++ ++++++++++.
----------.>++++++++[>++++<-]>.>++++++++++
[>++++++++<-]>+++++++.
++++++++++++++.>+++++++++[>++++++++++++<-]>.---------.>
++++++++++[>+++++++++++<-]>+.--.--------.>+++
[>++++++++++<-]>+++.>++++++++++
..>+[,[>+>+<<-][>>-<<+>>]>[[-.]<]],
I've tried for ages to figure out what's wrong with this code, but everything I've done has messed it up.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对我有用,试试这个 BF 解释器
Works for me, try this BF interpreter