1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Brainf*ck方言そーなのかー

Posted at

命令は「そー」と「なの」「かー」の3つのみ。
それ以外の文字は無視される。

言語で使用する予約語を減らすため、命令はオーダーで指定する。
[]+-のように命令が対照になっていることに着目して、それらをスイッチで切り替える設計にした。

  • そー
    オーダーを進める。範囲は0~3、超えたら0に戻る。
  • なの
    以下の表のオーダーとスイッチに対応した命令を実行。
  • かー
    スイッチ(true/false)切り替え

Brainf*ckと同等の機能をサポートする

オーダー スイッチ Brainf*ck命令
0 true >
0 false <
1 true +
1 false -
2 true .
2 false ,
3 true [
3 false ]

実装

1
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?