Execute SNUSP: Difference between revisions
Content added Content deleted
m (→{{header|Wren}}: Changed to Wren S/H) |
(Added Easylang) |
||
Line 84: | Line 84: | ||
=={{header|D}}== |
=={{header|D}}== |
||
See [[RCSNUSP/D]]. |
See [[RCSNUSP/D]]. |
||
=={{header|EasyLang}}== |
|||
{{trans|Go}} |
|||
<syntaxhighlight> |
|||
proc snusp dlen raw$ . . |
|||
len ds[] dlen |
|||
is$[] = strsplit raw$ "\n" |
|||
for s$ in is$[] |
|||
is$[][] &= strchars s$ |
|||
. |
|||
for ipr to len is$[][] |
|||
for ipc to len is$[ipr][] |
|||
if is$[ipr][ipc] = "$" |
|||
break 2 |
|||
. |
|||
. |
|||
. |
|||
dp = 1 |
|||
id = 0 |
|||
# |
|||
subr step |
|||
if id mod 2 = 0 |
|||
ipc += 1 - bitand id 2 |
|||
else |
|||
ipr += 1 - bitand id 2 |
|||
. |
|||
. |
|||
while ipr >= 1 and ipr <= len is$[][] and ipc >= 1 and ipc <= len is$[ipr][] |
|||
c$ = is$[ipr][ipc] |
|||
if c$ = ">" |
|||
dp += 1 |
|||
elif c$ = "<" |
|||
dp -= 1 |
|||
elif c$ = "+" |
|||
ds[dp] += 1 |
|||
elif c$ = "-" |
|||
ds[dp] -= 1 |
|||
elif c$ = "." |
|||
write strchar ds[dp] |
|||
elif c$ = "," |
|||
# ds[dp] = strcode input |
|||
elif c$ = "/" |
|||
id = bitxor id 3 |
|||
elif c$ = "\\" |
|||
id = bitxor id 1 |
|||
elif c$ = "!" |
|||
step |
|||
elif c$ = "?" |
|||
if ds[dp] = 0 |
|||
step |
|||
. |
|||
. |
|||
step |
|||
. |
|||
. |
|||
s$ = input |
|||
while s$ <> "" |
|||
cod$ &= "\n" & s$ |
|||
s$ = input |
|||
. |
|||
snusp 5 cod$ |
|||
# |
|||
input_data |
|||
/++++!/===========?\>++.>+.+++++++..+++\ |
|||
\+++\ | /+>+++++++>/ /++++++++++<<.++>./ |
|||
$+++/ | \+++++++++>\ \+++++.>.+++.-----\ |
|||
\==-<<<<+>+++/ /=.>.+>.--------.-/` |
|||
</syntaxhighlight> |
|||
=={{header|F_Sharp|F#}}== |
=={{header|F_Sharp|F#}}== |