moved test scripts to new tests dir and made them executable

This commit is contained in:
Bob Polis
2020-09-21 10:45:06 +02:00
parent 749ae0faa7
commit 98602abb9e
4 changed files with 8 additions and 0 deletions

53
tests/gcd Executable file
View File

@ -0,0 +1,53 @@
#!/usr/bin/env curly
>main
gto
:gcd
=v
=u
$u
$v
>gcd-loop
gge
$u
=t
$v
=u
$t
=v
:gcd-loop
$v
0
>gcd-ret
gle
$v
=t
$u
$v
mod
=v
$t
=u
>gcd-loop
gto
:gcd-ret
$u
ret
:lcm
=b
=a
$a
$a
$b
>gcd
fun
div
$b
mul
ret
:main
21
6
>lcm
fun
out
end

23
tests/hello Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env curly
3
=cnt
\Hello, world!
enl
=hello
\
=result
:loop
$result
$hello
cat
=result
$cnt
dec
=cnt
$cnt
0
>loop
ggt
$result
out
end

42
tests/slicer Executable file
View File

@ -0,0 +1,42 @@
#!/usr/bin/env curly
>main
gto
:slicer
=step
=to
=from
=str
$from
=i
\
=result
:loop
$result
$str
$i
idx
cat
=result
$i
$step
add
=i
$i
$str
len
>loop
glt
$result
ret
:main
\Avans Hogeschool
=text
$text
0
$text
len
2
>slicer
fun
out
end

8
tests/whats-your-name Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env curly
\What's your name?
out
\Hello,
inp
cat
out
end