Print newline in Fish (the programming language)?

时间:2015-10-06 08:14:27

标签: newline fish-esolang

I'm having trouble with the fish programming language wherein I cannot make a single (or, in fact, any length of) character (not including quotes) new line. Not even regex works for this. As it is a 2-D Programming Language, a new line breaks the code - it doesn't execute as intended. My code is a modified fibonacci sequence generator as shown on the wiki page, but uses literal spaces to print to the command line. It is below, if this helps in any way:

0:n" "o1:nv
 n:+@:o" "<

So, my question is this: is there a newline character or series of characters that I can use instead of the spaces? Should I pursue a different new line procedure (i.e. running as many outputs as I need to a file and THEN changing them all to new lines)?

1 个答案:

答案 0 :(得分:5)

看起来有点困难并且清了我的眼睛,看了一下ASCII表并检查了Fish中的堆栈后,我意识到我的回答很简单:

ao;

这个Fish背后的原因将堆栈中的字符存储为数字。因此,将数字10(Fish在src中接受十六进制)加载到堆栈中,然后使用o(简单字符输出)打印它将打印回车符。

因此,我的代码变为:

0:nao1:nv
 n:+@:oa<

在我这样做之后,那是显而易见的。希望这有助于将来的其他人。