openbirch-rs/test.txt

34 lines
416 B
Plaintext

zip(x,y) :=
if (length(x) = length(y)) = false then
break
else
out := [];
i := 0;
loop
if i = length(x) then
break
end
out <- out + [[get(x,i), get(y,i)]];
i <- i+1
end;
out
end;
fact'(a,x) :=
block
loop
if x < 1 then
break
end
a <- a*x
x <- x-1
end;
a
end;
fact(x) := fact'(1,x);
print(fact(5))