Sha256: 7234ed4799d8afa2e77cda607a9b8bcb384a3bc534cd8c75bf86e64ebb608ca5

Contents?: true

Size: 1 KB

Versions: 10

Compression:

Stored size: 1 KB

Contents

Standard Hello, world example, modified for this task:
!v"Hello world!"r!
 >l?!;o
Explanation of the code:<br/>
<tt>!v"</tt> jumps over the <tt>v</tt> character with the <tt>!</tt> sign, then starts the string mode with <tt>"</tt> .<br/>
Then the characters <tt>Hello world!</tt> are added, and string mode is closed with <tt>"</tt>.<br/>
The stack is reversed for printing (<tt>r</tt>), and a jump (<tt>!</tt>) is executed to jump over the <tt>!</tt> at the beginning of the line and execute the <tt>v</tt>. ([[Fish]] is torical)<br/>
After going down by <tt>v</tt>, it goes rightwards again by <tt>></tt> and this line is being executed.<br/>
This line pushes the stack size (<tt>l</tt>), and stops (<tt>;</tt>) if the top item on the stack is equal to 0 (<tt>?</tt>). Else it executes the <tt>!</tt> directly after it and jumps to the <tt>o</tt>, which outputs the top item in [http://en.wikipedia.org/wiki/Ascii ASCII]. Then the line is executed again. It effectively prints the stack until it's empty, then it terminates.

Version data entries

10 entries across 7 versions & 1 rubygems

Version Path
zettacode-0.1.7 files.zettacode/hello_world.text/fish.txt
zettacode-0.1.6 files.zettacode/hello_world.text/fish.txt
zettacode-0.1.6 files.zettacode2/hello_world.text/fish.txt
zettacode-0.1.5 files.zettacode/hello_world.text/fish.txt
zettacode-0.1.5 files.zettacode2/hello_world.text/fish.txt
zettacode-0.1.4 files.zettacode/hello_world.text/fish.txt
zettacode-0.1.4 files.zettacode2/hello_world.text/fish.txt
zettacode-0.1.3 files.zettacode/hello_world.text/fish.txt
zettacode-0.1.2 files.zettacode/hello_world.text/fish.txt
zettacode-0.1.1 zettacode.files/hello_world.text/fish.txt