2017 © Pedro Peláez
 

library php-fxxk

An easy-customizable Brainfuck interpreter for PHP

image

ryo-utsunomiya/php-fxxk

An easy-customizable Brainfuck interpreter for PHP

  • Monday, February 20, 2017
  • by ryo-utsunomiya
  • Repository
  • 1 Watchers
  • 1 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 10 % Grown

The README.md

php-fxxk

An easy-customizable Brainfuck interpreter for PHP., (*1)

Install

composer require ryo-utsunomiya/php-fxxk

Usage

<?php

require_once __DIR__ . '/vendor/autoload.php';

use BrainFuck\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);
    }
}

Special Thanks

Inspired by: https://github.com/masarakki/r-fxxk, (*2)

Forked from: https://github.com/ircmaxell/PHP-BrainFuck, (*3)

The Versions

20/02 2017

dev-master

9999999-dev

An easy-customizable Brainfuck interpreter for PHP

  Sources   Download

MIT

The Development Requires

by Ryo Utsunomiya

20/02 2017

0.2.1

0.2.1.0

An easy-customizable Brainfuck interpreter for PHP

  Sources   Download

MIT

The Development Requires

by Ryo Utsunomiya

19/02 2017

0.2.0

0.2.0.0

An easy-customizable Brainfuck interpreter for PHP

  Sources   Download

MIT

The Development Requires

by Ryo Utsunomiya

19/02 2017

0.1.0

0.1.0.0

An easy-customizable Brainfuck interpreter for PHP

  Sources   Download

The Development Requires

by Ryo Utsunomiya