turn test files in one function definition
This commit is contained in:
parent
87ab8941ed
commit
a1b3e82dc9
16 changed files with 114 additions and 82 deletions
|
@ -1,24 +1,26 @@
|
|||
# find the 10,001st prime
|
||||
# store it in a
|
||||
|
||||
@start
|
||||
@loop
|
||||
function $test {
|
||||
@start
|
||||
@loop
|
||||
%n =w phi @start 5, @tloop %n, @yes %n1
|
||||
%p =w phi @start 13, @tloop %p1, @yes %p1
|
||||
%p1 =w add %p, 2
|
||||
@tloop
|
||||
@tloop
|
||||
%t =w phi @loop 3, @next %t1
|
||||
%r =w rem %p, %t
|
||||
jnz %r, @next, @loop
|
||||
@next
|
||||
@next
|
||||
%t1 =w add 2, %t
|
||||
%tsq =w mul %t1, %t1
|
||||
%c0 =w csgt %tsq, %p
|
||||
jnz %c0, @yes, @tloop
|
||||
@yes
|
||||
@yes
|
||||
%n1 =w add 1, %n
|
||||
%c1 =w ceq 10001, %n1
|
||||
jnz %c1, @end, @loop
|
||||
@end
|
||||
@end
|
||||
storew %p, $a
|
||||
ret
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue