Jump to content

Execute SNUSP: Difference between revisions

m
Line 117:
$==>==@/==@/==<==#"""
 
@enum Direction dleftleft dupup drightright ddowndown
 
function snusp(datalength, progstring)
Line 123:
data = zeros(datalength)
dp = ipx = ipy = 1
direction = drightright # default to go to right at beginning
 
lines = split(progstring, "\n")
Line 148:
inboundsy(plus) = (plus ? (ipy < length(lines)) : (ipy > 1)) ? true : exit(data[dp])
function ipnext()
if direction == drightright && inboundsx(true) ipx += 1
elseif direction == dleftleft && inboundsx(false) ipx -= 1
elseif direction == ddowndown && inboundsy(true) ipy += 1
elseif direction == dupup && inboundsy(false) ipy -= 1
end
end
4,105

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.