Printing a new line in Fish (programming language)?

I am having problems with a fish programming language in which I cannot create a single (or, in fact, any) character (not including quotation marks) a new line. The regular expression does not work for this. Since this is a two-dimensional programming language, a new line interrupts the code - it does not execute as intended. My code is a modified fibonacci sequence generator, as shown on the wiki page, but uses literals to print on the command line. Below if it helps anyway:

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

So my question is this: is there a newline character or a series of characters that I can use instead of spaces? Should I use another new linear procedure (i.e., Run as much output as I need for the file, and THEN change them all to new lines)?

+7
newline fish-esolang
source share
1 answer

I looked a little harder and cleared my eyes, and by looking at the ASCII table and examining the stacks in Fish, I realized that my answer was as simple as this:

 ao; 

The rationale for this fish holds the characters on the stack as numbers. Therefore, loading the number 10 (Fish accepts hexadecimal in src) onto the stack and then printing it with o (simple character output), a carriage return is printed.

So my code becomes:

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

It was so obvious that it hurt after I did it. Hope this helps someone else in the future.

+4
source share

All Articles