Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
43
Task/Subleq/EasyLang/subleq.easy
Normal file
43
Task/Subleq/EasyLang/subleq.easy
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
global inpos inp$ .
|
||||
func inp .
|
||||
if inpos = 0
|
||||
inp$ = input
|
||||
if error = 1
|
||||
return 255
|
||||
.
|
||||
inpos = 1
|
||||
.
|
||||
if inpos <= len inp$
|
||||
h = strcode substr inp$ inpos 1
|
||||
inpos += 1
|
||||
return h
|
||||
.
|
||||
inpos = 0
|
||||
return 10
|
||||
.
|
||||
proc subleq . mem[] .
|
||||
repeat
|
||||
a = mem[p]
|
||||
b = mem[p + 1]
|
||||
c = mem[p + 2]
|
||||
p += 3
|
||||
if a = -1
|
||||
mem[b] = inp
|
||||
elif b = -1
|
||||
write strchar mem[a]
|
||||
else
|
||||
mem[b] -= mem[a]
|
||||
if mem[b] <= 0
|
||||
p = c
|
||||
.
|
||||
.
|
||||
until p < 0
|
||||
.
|
||||
.
|
||||
prog[] = [ 15 17 -1 17 -1 -1 16 1 -1 16 3 -1 15 15 0 0 -1 72 101 108 108 111 44 32 119 111 114 108 100 33 10 0 ]
|
||||
arrbase prog[] 0
|
||||
#
|
||||
subleq prog[]
|
||||
#
|
||||
input_data
|
||||
dummy data
|
||||
Loading…
Add table
Add a link
Reference in a new issue