解读DOGO
DOGO是鲜为人知的编程语言。最初的DOGO(Usenet帖子中的玩笑语言)从未实现,但已经创建了类似的语言。该语言的命令为:
+===========+================================================================+
| Command | Description |
+===========+================================================================+
| SIT | If the value of the current memory cell is 0, jump to STAY. |
+-----------+----------------------------------------------------------------+
| STAY | If the value of the current memory cell is not 0, jump to SIT. |
+-----------+----------------------------------------------------------------+
| ROLL-OVER | Select the next operation from the operation list. |
+-----------+----------------------------------------------------------------+
| HEEL | Execute the currently selected operation. |
+-----------+----------------------------------------------------------------+
操作是:
+========+=======================================================+====+
| Number | Description | BF |
+========+=======================================================+====+
| 0 | Increment current memory cell. | + |
+--------+-------------------------------------------------------+----+
| 1 | Decrement current memory cell. | - |
+--------+-------------------------------------------------------+----+
| 2 | Move to next memory cell. | > |
+--------+-------------------------------------------------------+----+
| 3 | Move to previous memory cell. | < |
+--------+-------------------------------------------------------+----+
| 4 | Input a byte and store it in the current memory cell. | , |
+--------+-------------------------------------------------------+----+
| 5 | Output the current memory cell as ASCII. | . |
+--------+-------------------------------------------------------+----+
例子
你好,世界:
roll-over roll-over heel roll-over roll-over roll-over roll-over heel heel heel
heel heel heel heel heel heel sit roll-over roll-over roll-over heel roll-over
roll-over roll-over heel heel heel heel heel heel heel heel roll-over roll-over
heel roll-over roll-over roll-over roll-over roll-over heel roll-over roll-over
roll-over roll-over roll-over stay roll-over roll-over roll-over heel roll-over
roll-over heel roll-over roll-over roll-over heel roll-over roll-over roll-over
roll-over heel heel heel heel heel heel heel sit roll-over roll-over roll-over
heel roll-over roll-over roll-over heel heel heel heel roll-over roll-over heel
roll-over roll-over roll-over roll-over roll-over heel roll-over roll-over
roll-over roll-over roll-over stay roll-over roll-over roll-over heel roll-over
roll-over roll-over heel roll-over roll-over roll-over roll-over roll-over heel
roll-over heel heel heel heel heel heel heel roll-over roll-over roll-over
roll-over roll-over heel heel roll-over heel heel heel roll-over roll-over
roll-over roll-over roll-over heel roll-over roll-over roll-over heel heel heel
roll-over roll-over roll-over roll-over heel heel heel heel heel heel heel heel
sit roll-over roll-over roll-over heel roll-over roll-over roll-over heel heel
heel heel roll-over roll-over heel roll-over roll-over roll-over roll-over
roll-over heel roll-over roll-over roll-over roll-over roll-over stay roll-over
roll-over roll-over heel roll-over roll-over heel roll-over roll-over roll-over
heel heel heel roll-over roll-over roll-over roll-over heel heel heel heel heel
heel heel heel heel heel sit roll-over roll-over roll-over heel roll-over
roll-over roll-over heel heel heel heel heel heel heel heel heel roll-over
roll-over heel roll-over roll-over roll-over roll-over roll-over heel roll-over
roll-over roll-over roll-over roll-over stay roll-over roll-over roll-over heel
roll-over roll-over roll-over roll-over heel heel heel roll-over roll-over
roll-over roll-over heel roll-over roll-over roll-over roll-over heel heel heel
heel roll-over roll-over heel roll-over heel heel heel roll-over roll-over
roll-over roll-over roll-over heel roll-over roll-over heel heel heel heel heel
heel roll-over roll-over roll-over roll-over heel roll-over roll-over heel heel
heel heel heel heel heel heel roll-over roll-over roll-over roll-over heel
roll-over roll-over roll-over heel heel roll-over roll-over roll-over roll-over
heel roll-over roll-over roll-over roll-over roll-over heel
规则
- 每个提交应该是完整的程序或功能。如果它是一个函数,则只需将函数调用添加到程序底部即可使其可运行。其他任何内容(例如C中的标头)都必须包括在内。
- 如果可能,请提供一个可以测试您的代码的在线站点的链接。
- 您的程序无法写入任何内容
STDERR
(或类似内容)。 - 您可以从
STDIN
(或使用您语言中最接近的替代语言)输入,也可以作为参数。 - 禁止出现标准漏洞。
计分
程序根据字节计分。默认字符集为UTF-8,如果使用其他字符集,请指定。
除此之外,这是 代码高尔夫球,最低字节数将被视为获胜者!
意见书
为确保您的答案显示出来,请使用以下Markdown模板以标题开头。
# Language Name, N bytes
N
您提交的文件大小在哪里。如果您提高了分数,则可以通过打败旧分数来保持标题。例如:
# Ruby, <s>104</s> <s>101</s> 96 bytes
如果要在标头中包含多个数字(例如,因为您的分数是两个文件的总和,或者您想单独列出解释器标志罚分),请确保实际分数是标头中的最后一个数字:
# Perl, 43 + 2 (-p flag) = 45 bytes
您还可以将语言名称设置为链接,然后该链接将显示在页首横幅代码段中:
# [><>](http://esolangs.org/wiki/Fish), 121 bytes
排行榜
这是一个堆栈片段,用于按语言生成常规排行榜和获胜者概述。
更新:
抱歉,无法很好地阐明sit
and stay
命令。正如@ user6245072所说,它们[
与]
BF中的一样。
更新2:
为了澄清@KennyLau的问题:
- 默认操作是
0
。 - 存储器由8位单元组成。
- 单元会在上溢/下溢时自动换行。
- 操作4需要输入。
1
说“增加下一个单元格”,但相应的BF代码是“减少当前单元格”。哪个是正确的行为?
sit lie-down roll-over play-dead heel