Skip to main content
Post Made Community Wiki by Dennis
Changed some stuff
Source Link
123\i;123|i;

\| can also be replaced with |\ (the left-shift operator) to shift the stack one position left instead of right. This has a surprising number of applications in Plurp.

39&'\\\s;39&'|||s;
123\i;

\ can also be replaced with | (the left-shift operator) to shift the stack one position left instead of right. This has a surprising number of applications in Plurp.

39&'\\\s;
123|i;

| can also be replaced with \ (the left-shift operator) to shift the stack one position left instead of right. This has a surprising number of applications in Plurp.

39&'|||s;
improved formatting & changed some words
Source Link

This Programming LanguagePlurp

Factoid: This programming languagePlurp is a two-dimensional programming language closely related to
><> (fish) and more distantly Befunge. It is based oninspired by ><>.

An infinite loop. Like in ><> and Befunge, code will wrap around in this programming language. Note that in the interpreter, this will not result in an infinite loop as the interpreter gives up after (by default) 2048 commandsPlurp.

Outputs 1 indefinitely (theoretically). Any number from 00 to 99 would do pretty much the same. Note: i outputs the whole stack as a [non-delimited] string of numbers, s as a string of characters - generated from the numbers on the stack.

Finally! Something interesting! This is a catcat program which outputs its input.

Demonstrates the poppop (~) function. Although this pushes 1 to the stack, it is popped and ittherefore the program outputs nothing. (Not very interesting, I know.)

Prints a. This demonstrates the string parsing function: when an ' is encountered, the rest of the characters are pushed to the stack as character codes until another ' is encountered. This leads to the escape for ' being quite costly: '39&' (Note:

The & used in '39&' concatenates the top two numbers on the stack [e.g. (39 -->is [3, 9] |but 39& -->is [39]]).

Demonstrates the right-shift function. 1, 2, and 3 are pushed onto the stack, then the stack is shifted right (by one position). The output of this program is 312"312", as the 3 wraps around.   

\ can also be replaced with | (the left-shift operator) to shift the stack one position left instead of right. While this does not seem to be very interesting, itThis has a surprising number of applications in this programming languagePlurp.

Yay! Stacks! This programming language, likeLike ><>, Plurp can create multiple stacks and run operations on themeach stack independent of other stacks (side note: this programming language has only one register and, unlike ><>, new registers are not created with new stacks)the others. 

There are three different kinds of stacks - additive ([), overlap ((), and copy additive ({). Stacks are classified by their behaviours when opened and closed with (]) or flattened with (f). 

Additive stacks will be empty when open ([]) and will add their data to the end of the next stack when closed (i.e. 4[11+]&i;4[2]i; outputs 42). 

Overlap stacks will be empty when open and will add their data to the beginning of the next stack when closed (i.e. 4(11+]&i;2]i; outputs 2). 

Copy additive stacks are like additive stacks, but they open with the data of the nextlast stack (i.ealready in them. 4{11+]&i;2+]i; outputs 442). A stack trace of this program is as follows: [8] [8][4] [8][42] [8]["42"] [842] [end], where "" indicates something that is outputted.

What? Is this program not working correctly? No. As mentioned in the previous snippet, this programming language, likeLike ><>, Plurp has a register (albeit only a single one). When thea " command is calledencountered, the interpreter checks if the register is empty. If it is, the top value on the stack is popped and pushed ontointo the register. Otherwise, the value in the register is popped and pushed ontointo the stack. 

Therefore, even though there are two i commands, only one outputs 42 because the other is called while 42 is in the register and not the stack.

This Programming Language

Factoid: This programming language is a two-dimensional programming language closely related to
><> and more distantly Befunge. It is based on ><>.

An infinite loop. Like ><> and Befunge, code will wrap around in this programming language. Note that in the interpreter, this will not result in an infinite loop as the interpreter gives up after (by default) 2048 commands.

Outputs 1 indefinitely (theoretically). Any number from 0 to 9 would do pretty much the same. Note: i outputs the whole stack as a [non-delimited] string of numbers, s as a string of characters - generated from the numbers on the stack.

Finally! Something interesting! This is a cat program which outputs its input.

Demonstrates the pop (~) function. Although this pushes 1 to the stack, it is popped and it outputs nothing. (Not very interesting, I know.)

Prints a. This demonstrates the string parsing function: when an ' is encountered, the rest of the characters are pushed to the stack as character codes until another ' is encountered. This leads to the escape for ' being quite costly: '39&' (Note: & concatenates the top two numbers on the stack [e.g. 39 --> [3, 9] | 39& --> [39]])

Demonstrates the right-shift function. 1, 2, and 3 are pushed onto the stack, then the stack is shifted right (by one position). The output of this program is 312.  \ can be replaced with | (the left-shift operator) to shift the stack one position left instead of right. While this does not seem to be very interesting, it has a surprising number of applications in this programming language.

Yay! Stacks! This programming language, like ><> can create multiple stacks and run operations on them independent of other stacks (side note: this programming language has only one register and, unlike ><>, new registers are not created with new stacks). There are three different kinds of stacks - additive ([), overlap ((), and copy additive ({). Stacks are classified by their behaviours when opened and closed (]) or flattened (f). Additive stacks will be empty when open ([]) and will add their data to the end of the next stack when closed (i.e. 4[11+]&i; outputs 42). Overlap stacks will be empty when open and will add their data to the beginning of the next stack when closed (i.e. 4(11+]&i; outputs 2). Copy additive stacks are like additive stacks, but they open with the data of the next stack (i.e. 4{11+]&i; outputs 442). A stack trace of this program is as follows: [8] [8][4] [8][42] [8]["42"] [842] [end], where "" indicates something that is outputted.

What? Is this program not working correctly? No. As mentioned in the previous snippet, this programming language, like ><>, has a register. When the " command is called, if the register is empty, the top value on the stack is popped and pushed onto the register. Otherwise, the value in the register is popped and pushed onto the stack. Therefore, even though there are two i commands, only one outputs 42 because the other is called while 42 is in the register and not the stack.

Plurp

Factoid: Plurp is a two-dimensional programming language closely related to
><> (fish) and Befunge. It is inspired by ><>.

An infinite loop. Like in ><> and Befunge, code will wrap around in Plurp.

Outputs 1 indefinitely. Any number from 0 to 9 would do pretty much the same.

Finally! Something interesting! This is a cat program which outputs its input.

Demonstrates the pop (~) function. Although this pushes 1 to the stack, it is popped and therefore the program outputs nothing.

Prints a. This demonstrates the string parsing function: when an ' is encountered, the rest of the characters are pushed to the stack as character codes until another ' is encountered. This leads to the escape for ' being quite costly: '39&'

The & used in '39&' concatenates the top two numbers on the stack (39 is [3, 9] but 39& is [39]).

Demonstrates the right-shift function. 1, 2, and 3 are pushed onto the stack, then the stack is shifted right (by one position). The output of this program is "312", as the 3 wraps around. 

\ can also be replaced with | (the left-shift operator) to shift the stack one position left instead of right. This has a surprising number of applications in Plurp.

Like ><>, Plurp can create multiple stacks and run operations on each stack independent of the others. 

There are three different kinds of stacks - additive [, overlap (, and copy additive {. Stacks are classified by their behaviours when opened and closed with ] or flattened with f. 

Additive stacks will be empty when open ([]) and will add their data to the end of the next stack when closed. 4[2]i; outputs 42. 

Overlap stacks will be empty when open and will add their data to the beginning of the next stack when closed. 4(2]i; outputs 2. 

Copy additive stacks are like additive stacks, but they open with the data of the last stack already in them. 4{2+]i; outputs 442.

Like ><>, Plurp has a register (albeit only a single one). When a " is encountered, the interpreter checks if the register is empty. If it is, the top value on the stack is popped and pushed into the register. Otherwise, the value in the register is popped and pushed into the stack. 

Therefore, even though there are two i commands, only one outputs 42 because the other is called while 42 is in the register and not the stack.

Added a note explaining the lack of updates
Source Link

Read Me

Currently the interpreter is broken due to the addition of an infinite-loop prevention system in Khan Academy. I'm working to fix it, and once I do I will catch up with this answer!

Read Me

Currently the interpreter is broken due to the addition of an infinite-loop prevention system in Khan Academy. I'm working to fix it, and once I do I will catch up with this answer!

added 389 characters in body
Source Link
Loading
added 528 characters in body
Source Link
Loading
added 1044 characters in body
Source Link
Loading
added 441 characters in body
Source Link
Loading
added 572 characters in body
Source Link
Loading
added 115 characters in body
Source Link
Loading
added 131 characters in body
Source Link
Loading
added 350 characters in body
Source Link
Loading
Source Link
Loading