Giter Site home page Giter Site logo

hexbf-from-php's Introduction

HexBF from php

Brainf*ckを元に作った自作言語をPHPで作成したものです。

仕組み

  • アドレスは二つのみ。
  • 一桁目が、16進数の上位ビット。
  • 二桁目が、16進数の下位ビット。
  • 初期指定アドレスは二桁目。
  • []のネスト数は最大8(超えると、overflowとなり、処理を中断する)。

操作

Brainf*ckと操作はほぼ同じです。

入力 説明
+ 指定アドレス値をインクリメント
- 指定アドレス値をデクリメント
< 指定アドレスを一桁左にずらす
> 指定アドレスを一桁右にずらす
. 全体の値をASCIIコードで文字列に変換し、出力
[ 指定アドレス値が0出ない場合、]まで実行
] 指定アドレス値が0だった場合、]に戻る
  • <,>をしたとき、指定アドレスはループするようになっています。

例)<<+の値は、0x01
  >+の値は、0x10となります。

初期値

  • 指定アドレスは、下位ビットです。
  • アドレス値は、上位下位ともに0(0x00)です。

入力

++++++++<++++.>---.+++++++..+++.---------------<--.+++>+++++++.++++++++<-.+>-------------.++++++++++<-.>--------.---<--..

出力

HELLO WORLD!!

現時点(2018/07/19)でのバグ

  • [] のネストが最大で8個までとなっていること。

2018/06/22でのバグ

  • [] の処理がアドレス全体の値で適応となり、[-]をすると強制的に初期値(0x00)となります。
  • 0x08(\b)は、非対応となっています。

hexbf-from-php's People

Contributors

nacl5alt avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.