Execute SNUSP/D: Difference between revisions

Content added Content deleted
m (Eso link)
m (<code> uh oh...double backslash problem)
Line 18: Line 18:
::*In this implementation, the order of execution is first-created-first-executed;
::*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.
::*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.
:::<code style="line-height: 1em;">$*&\==&\:&\:&\:=\<br>&nbsp;&nbsp;&nbsp;;&nbsp;&nbsp;&nbsp;~&nbsp;&nbsp;~&nbsp;&nbsp;~&nbsp;&nbsp;~&nbsp;&\=>&nbsp;new(B)<br>&nbsp;&nbsp;&nbsp;;&nbsp;&nbsp;2A&nbsp;3B&nbsp;4C&nbsp;5D&nbsp;&nbsp;\=>&nbsp;old(A)<br>&nbsp;&nbsp;&nbsp;;&nbsp;&nbsp;&nbsp;\=!\=!\=!\===*..=.#<br>&nbsp;&nbsp;&nbsp;;&nbsp;&nbsp;&nbsp;/=!/=!/=!/===*.=.=.#<br>&nbsp;&nbsp;&nbsp;;&nbsp;&nbsp;1b&nbsp;6c&nbsp;7d&nbsp;8a&nbsp;&\=>&nbsp;old(a)<br>&nbsp;&nbsp;&nbsp;;&nbsp;&nbsp;&nbsp;~&nbsp;&nbsp;~&nbsp;&nbsp;~&nbsp;&nbsp;~&nbsp;&nbsp;\=>&nbsp;new(b)<br>&nbsp;&nbsp;&nbsp;\==&/;&/;&/;=/&nbsp;&nbsp;<br></code>
:::<tt style="line-height: 1em;">$*&\==&\:&\:&\:=\<br>&nbsp;&nbsp;&nbsp;;&nbsp;&nbsp;&nbsp;~&nbsp;&nbsp;~&nbsp;&nbsp;~&nbsp;&nbsp;~&nbsp;&\=>&nbsp;new(B)<br>&nbsp;&nbsp;&nbsp;;&nbsp;&nbsp;2A&nbsp;3B&nbsp;4C&nbsp;5D&nbsp;&nbsp;\=>&nbsp;old(A)<br>&nbsp;&nbsp;&nbsp;;&nbsp;&nbsp;&nbsp;\=!\=!\=!\===*..=.#<br>&nbsp;&nbsp;&nbsp;;&nbsp;&nbsp;&nbsp;/=!/=!/=!/===*.=.=.#<br>&nbsp;&nbsp;&nbsp;;&nbsp;&nbsp;1b&nbsp;6c&nbsp;7d&nbsp;8a&nbsp;&\=>&nbsp;old(a)<br>&nbsp;&nbsp;&nbsp;;&nbsp;&nbsp;&nbsp;~&nbsp;&nbsp;~&nbsp;&nbsp;~&nbsp;&nbsp;~&nbsp;&nbsp;\=>&nbsp;new(b)<br>&nbsp;&nbsp;&nbsp;\==&/;&/;&/;=/&nbsp;&nbsp;<br></tt>
*'''^ : warp''' (teleport):
*'''^ : warp''' (teleport):
#The code pointer will bounce back to the code space boundary in its reverse direction;
#The code pointer will bounce back to the code space boundary in its reverse direction;
Line 25: Line 25:
:::==a^A&lt;=cp==B^==&lt;=C^==
:::==a^A&lt;=cp==B^==&lt;=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.
::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.
<d>module snud ;
<code d>module snud ;
private import std.string, std.random ;
private import std.string, std.random ;


Line 210: Line 210:
private char[char] acceptCmd ;
private char[char] acceptCmd ;
private uint Id = 0 ;
private uint Id = 0 ;
}</d>
}</code>
Sample SNUSP using a console io :
Sample SNUSP using a console io :
<d>module rcsnusp ;
<code d>module rcsnusp ;
import snud ;
import snud ;
import std.stdio, std.file, std.conv ;
import std.stdio, std.file, std.conv ;
Line 263: Line 263:


return result ;
return result ;
}</d>
}</code>