プログラム言語

7c57cc6d anonymous 2011-01-10 01:25
>>1b794eb6
半分以下のコード。やっと動かし方がわかったので。

>>>+[[-]>>[-]++>+>+++++++[<++++>>++<-]++>>+>+>+++++[>++>++++++<<-]+>>>,<++[[>[
->>]<[>>]<<-]<[<]<+>>[>]>[<+>-[[<+>-]>]<[[[-]<]++<-[<+++++++++>[<->-]>>]>>]]<<
]<]<[[<]>[[>]>>[>>]+[<<]<[<]<+>>-]>[>]+[->>]<<<<[[<<]<[<]+<<[+>+<<-[>-->+<<-[>
+<[>>+<<-]]]>[<+>-]<]++>>-->[>]>>[>>]]<<[>>+<[[<]<]>[[<<]<[<]+[-<+>>-[<<+>++>-
[<->[<<+>>-]]]<[>+<-]>]>[>]>]>[>>]>>]<<[>>+>>+>>]<<[->>>>>>>>]<<[>.>>>>>>>]<<[
>->>>>>]<<[>,>>>]<<[>+>]<<[+<<]<]
[input a brainfuck program and its input, separated by an exclamation point.
Daniel B Cristofani (cristofdathevanetdotcom)
http://www.hevanet.com/cristofd/brainfuck/]

上記BFをdbfi.bとし、BFインタプリタをbf、実行したいBFをhello.bとすると、
echo -n '!' | cat hello.b - | bf dbfi.b

要するに、ファイル終端記号として ! を使うということらしい。だからhello.bの最後に!を追記して
bf dbfi.b < hello.b
でもいいようだ。

Top of this page. | <<last 0 1 2

limit: 15360KB

(プログラム言語/244/0.1MB)

Powered by shinGETsu.