Execute SNUSP/D: Difference between revisions
m
Fixed syntax highlighting.
m (Eso link) |
m (Fixed syntax highlighting.) |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 1:
{{implementation|SNUSP}}{{collection|RCSNUSP}}
This [[D]] implementation supports commands from all the three SNUSP variants, as described on the [[eso:SNUSP|Esolang SNUSP page]], plus an extended mode, '''SUPERNATURAL'''.
'''SUPERNATURAL Mode''':
Line 18:
::*In this implementation, the order of execution is first-created-first-executed;
::*The original specification specifies that ''(&)SPLIT''-ed old thread skips the immediate code (see below a->b->c->d example), which may lead to anti-intuition codes (which is good for an esoteric language :). This implementation retain old-thread-skips-immediate-code behavior in ''BLOATED'' mode, but new-thread-skips-immediate-code in ''SUPERNATURAL'' mode ( A->B->C->D example). 1->2->...->8 is thread creation order in ''SUPERNATURAL'' mode.
:::<
*'''^ : warp''' (teleport):
#The code pointer will bounce back to the code space boundary in its reverse direction;
Line 25:
:::==a^A<=cp==B^==<=C^==
::when the code pointer cp heading into A's^, next turn, the code pointer will be in C. if no such ^ in the reverse direction, the code pointer will be in ''a'' next turn.
<syntaxhighlight lang="d">module snud ;
private import std.string, std.random ;
Line 210:
private char[char] acceptCmd ;
private uint Id = 0 ;
}</
Sample SNUSP using a console io :
<syntaxhighlight lang="d">module rcsnusp ;
import snud ;
import std.stdio, std.file, std.conv ;
Line 263:
return result ;
}</
|