Files
news.gitea.happylizard.me/bin/gems/rouge-4.5.1/lib/rouge/demos/nial
T
pizza2d1 4cee170d66
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s
Add bin and edit workflow
2026-09-16 13:11:16 -06:00

36 lines
668 B
Plaintext

% Functional Recursion: ;
fact IS RECUR [ 0 =, 1 first, pass, product, -1 +] % from wikipedia;
% Product of a range: ;
fact IS * count;
% Plain recursion: ;
fact IS OPERATION x {
if x = 0 then 1 else x * fact (x - 1) endif
};
% While loop: ;
fact IS OPERATION x {
prod := 1;
WHILE x > 0 DO
prod := prod * x;
x := x - 1;
ENDWHILE;
prod
}
% A basic divide by zero error: ;
1 / 0
# OUTPUT:
?div
% Errors are also values called faults, giving you their location: ;
5 / 5 10 0 8
# OUTPUT:
1. 0.5 ?div 0.625
% You can also define custom faults using 'fault': ;
fault 'this is an error'
# OUTPUT:
this is an error