コード例 #1
0
ファイル: countdown.php プロジェクト: nbartels/php-brainfuck
<?php

include "../brainfuck.php";

$interpreter = new Brainfuck();
$interpreter->setSource(
"ASCII character for '9':
 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
 ASCII character for ' ' (space):
 >++++++++++++++++++++++++++++++++
 
 Loop counter set to 10
 >++++++++++
 
 Run loop
 [<<.->.>-]"
);

echo $interpreter->execute()->getOutput();

?>
コード例 #2
0
ファイル: prime.php プロジェクト: nbartels/php-brainfuck
<?php

include "../brainfuck.php";

$interpreter = new Brainfuck();
$interpreter->setSource(
"compute prime numbers
to use type the max number then push Alt 1 0
===================================================================
======================== OUTPUT STRING ============================
===================================================================
>++++++++[<++++++++>-]<++++++++++++++++.[-]
>++++++++++[<++++++++++>-]<++++++++++++++.[-]
>++++++++++[<++++++++++>-]<+++++.[-]
>++++++++++[<++++++++++>-]<+++++++++.[-]
>++++++++++[<++++++++++>-]<+.[-]
>++++++++++[<++++++++++>-]<+++++++++++++++.[-]
>+++++[<+++++>-]<+++++++.[-]
>++++++++++[<++++++++++>-]<+++++++++++++++++.[-]
>++++++++++[<++++++++++>-]<++++++++++++.[-]
>+++++[<+++++>-]<+++++++.[-]
>++++++++++[<++++++++++>-]<++++++++++++++++.[-]
>++++++++++[<++++++++++>-]<+++++++++++.[-]
>+++++++[<+++++++>-]<+++++++++.[-]
>+++++[<+++++>-]<+++++++.[-]

===================================================================
======================== INPUT NUMBER  ============================
===================================================================
+                          cont=1
[
コード例 #3
0
ファイル: beer.php プロジェクト: nbartels/php-brainfuck
<?php

include "../brainfuck.php";

$interpreter = new Brainfuck();
$interpreter->setSource(
"[ 99 Bottles of Beer in Brainf*** by Eric Bock - ebock@uswest.net ]

+++++++++>+++++++++>>>++++++[<+++>-]+++++++++>+++++++++>>>>>>+++++++++++++[<+++
+++>-]>+++++++++++[<++++++++++>-]<+>>++++++++[<++++>-]>+++++++++++[<++++++++++>
-]<->>+++++++++++[<++++++++++>-]<+>>>+++++[<++++>-]<-[<++++++>-]>++++++++++[<++
++++++++>-]<+>>>+++++++[<+++++++>-]>>>++++++++[<++++>-]>++++++++[<++++>-]>+++++
++++++[<+++++++++>-]<->>++++++++[<++++>-]>+++++++++++[<++++++++++>-]<+>>+++++++
+[<++++>-]>>+++++++[<++++>-]<+[<++++>-]>++++++++[<++++>-]>>+++++++[<++++>-]<+[<
++++>-]>>++++++++++++[<+++++++++>-]++++++++++>>++++++++++[<++++++++++>-]<+>>+++
+++++++++[<+++++++++>-]>>++++++++++++[<+++++++++>-]>>++++++[<++++>-]<-[<+++++>-
]>++++++++++++[<++++++++>-]<+>>>>++++[<++++>-]<+[<+++++++>-]>++++++++[<++++>-]>
++++++++[<++++>-]>+++++++++++[<++++++++++>-]<+>>++++++++++[<++++++++++>-]<+>>>+
+++[<++++>-]<+[<++++++>-]>+++++++++++++[<++++++++>-]>++++++++[<++++>-]>>+++++++
[<++++>-]<+[<++++>-]>+++++++++++[<+++++++++>-]<->>++++++++[<++++>-]>++++++++++[
<++++++++++>-]<+>>+++++++++++[<++++++++++>-]>++++++++++[<++++++++++>-]<+>>+++++
++++++[<++++++++++>-]<+>>>+++++[<++++>-]<-[<++++++>-]>++++++++[<++++>-]>+++++++
+++>>>>++++++++++++[<+++++++>-]++++++++++>>++++++++++++[<++++++++>-]<+>>+++++++
+++[<++++++++++>-]>++++++++++++[<+++++++++>-]<->>+++++++++++[<++++++++++>-]>+++
+++++++[<++++++++++>-]<+>>+++++++++++++[<+++++++++>-]>++++++++[<++++>-]>+++++++
++++[<++++++++++>-]<+>>>>+++++[<++++>-]<-[<++++++>-]>+++++++++++[<++++++++++>-]
<+>>++++++++++++[<++++++++>-]<+>>+++++++++++[<++++++++++>-]>++++++++[<++++>-]>+
+++++++++[<++++++++++>-]<+>>>+++++++[<++++>-]<+[<++++>-]>>>+++++[<+++>-]<[<++++
+++>-]>>+++++[<+++>-]<[<+++++++>-]>++++++++[<++++>-]>>+++++++[<++++>-]<+[<++++>
-]>>++++++[<++++>-]<-[<+++++>-]>>>++++++[<++++>-]<-[<+++++>-]>++++++++[<++++>-]
>++++++++++++[<++++++++>-]<+>>++++++++++[<++++++++++>-]>>++++[<++++>-]<[<++++++
コード例 #4
0
ファイル: helloworld.php プロジェクト: nbartels/php-brainfuck
<?php

include "../brainfuck.php";

$interpreter = new Brainfuck();
$interpreter->setSource(
  ">++++[<++++++++++++++++>-]<++++++++.>++[<++++++++++++++++>-]<---.+++++++..+++.
  >+++++[<---------------->-]<+.>+++[<++++++++++++++++>-]<+++++++.++++++++++++++
  ++++++++++.+++.------.--------."
);

echo $interpreter->execute()->getOutput();

?>
コード例 #5
0
ファイル: reverse.php プロジェクト: nbartels/php-brainfuck
<?php

include "../brainfuck.php";

$interpreter = new Brainfuck();
$interpreter->setSource("+[>,]<-[+.<-]");
$interpreter->setInput("Was it a car or a cat I saw?");

echo $interpreter->execute()->getOutput();
?>
コード例 #6
0
ファイル: echo.php プロジェクト: nbartels/php-brainfuck
<?php

include "../brainfuck.php";

$interpreter = new Brainfuck();
$interpreter->setSource(">+[>,]<[<]>>[.>]");
$interpreter->setInput("Hi, how are you?");

echo $interpreter->execute()->getOutput();

?>
コード例 #7
0
ファイル: add.php プロジェクト: nbartels/php-brainfuck
<?php

include "../brainfuck.php";

$interpreter = new Brainfuck();
$interpreter->setSource("+++>++++<#[>+<-]#");

echo $interpreter->execute()->getOutput();

?>