2
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?

Hello World あたたたた befunge編

Last updated at Posted at 2025-12-20

この記事は Hello World あたたたた Advent Calendar 2025の記事です。
この記事では、befungeで Hello World あたたたた を実装して解説していきます。
Hello World あたたたたについてはこれをご覧ください。

befungeとは

難解プログラミング言語(esolang)の一つで、この言語は命令ポインタが2次元のグリッドを上を移動する言語です。
スタック型の言語で、命令ポインタの進行方向「>,<,^,v」でを上下左右に切り替えができる。

Hello, World!
"!dlroW ,olleH">:v
               |,<
               @

使ったインタプリタ

esolang_park
->ブラウザ上で動かせるのに本格的、すごい!!!

コーディング例

可読性を高めるために「あをa」、「たをt」にしています

v    <
?"t",^

     v,"a"<     <     <     <
>"a",>    ?"t",>?"t",>?"t",>?"t",>"るいでん死うもは前お">:#,_@
          ^     ^     ^     ^

コードと文法の解説

文字出力

""で文字をスタックに入れる。
,で文字を出力する

Aを出力する
"A",

ランダム

?でランダムな方向にポインタの進行方向を変えられる

半分の確率で0か1を出力する
?"0",
>"1",

ループ

閉路のコード書けばいい

無限にAを出力する
>"A",v
^    <

「あ」の後「た」が4回出ればいいので
「た」が出た後、4回続いたら、「お前はもう死んでいる」と出ればいい。
なので、あがでたら最初に戻るようにした。

個人的な感想

楽しい。
本当に楽しい。
みんなもやってみてね。

2
0
3

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
2
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?