PHP code example of ryo-utsunomiya / php-fxxk
1. Go to this page and download the library: Download ryo-utsunomiya/php-fxxk library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ryo-utsunomiya / php-fxxk example snippets
composer
rainFuck\Language;
use BrainFuck\Mapping;
// Basic Brainfuck
$Language = new Language();
$output = $Language->run('++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.');
print_char_array($output);
// Customized mapping
$mapping = new Mapping([
'NXT',
'PRV',
'INC',
'DEC',
'PUT',
'GET',
'OPN',
'CLS'
]);
// Generate hello world program
$hw = $mapping->helloWorld();
// Use customized mapping
$Language = Language::withMapping($mapping);
$output = $Language->run($hw);
print_char_array($output);
function print_char_array(array $charArray)
{
foreach ($charArray as $char) {
echo chr($char);
}
}