1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Befungeのインタープリタを作ったった

Last updated at Posted at 2025-07-26

Befungeとは

難解プログラミング言語の一つ。
実行順序が上下左右に変化する。
詳しい解説は->Wikipediaページ

Brainfuckに続き、C++でインタープリタを作った。

使用技術

  • C++

インストール

Githubリポジトリ

  1. リポジトリをクローン

    • ssh
    git clone git@github.com:K10-K10/Befunge-interpreter
    
    • https
    git clone https://github.com/K10-K10/Befunge-interpreter.git
    
  2. コンパイル

    g++ main.cpp -o bef
    

    clang でも可

  3. コマンドを追加
    befbinにコピーする。(Ubuntu)

    sudo cp bef ~/.local/bin/bef
    
  4. binのパスを通す
    zshrcに追記

    export PATH="$HOME/.local/bin:$PATH"
    

インストール完了!

使って見る

hello.befを作成

v @_       v
>0"!dlroW"v 
v  :#     < 
>" ,olleH" v
   ^       <

これを書き込み、コンパイル

bef hello.bef

出力

Hello, World!

と出力されるはず

終わりに

brainfuckより、ループ処理が簡単で、実装も楽だった。
次はpietHQ9+のインタープリタを作ろうかな。
コンパイラを作れるようになりたい...

~Thank you for reading!~

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?