Mercurial > repo
annotate src/ploki/examples/fac.pk @ 5652:03316a477edd
<shachaf> mk canary.orig//hi
author | HackBot |
---|---|
date | Sun, 21 Jun 2015 18:52:51 +0000 |
parents | ac0403686959 |
children |
rev | line source |
---|---|
4223 | 1 "calculate the faculty of [1..8]: "ß{ |
2 REM faculty program in false and ploki | |
3 REM Lukas Mai, 11.09.2003 | |
4 REM} [$1=$[\%1\]?~[$1-f;!*]?]f: ^'0-$$0>~\8>|$ { | |
5 LET n @LEGS(\EING) | |
6 REM} | |
7 "result: "ß{ | |
8 IF n < 1 | (n > 8) | |
9 REM} ~[\f;!.]?[ | |
10 "illegal input"ß{ | |
11 ELSE | |
12 LET f 1 | |
13 FOR loop IF n > 0 | |
14 LET f f * n | |
15 LET n n - 1 | |
16 NEXT loop | |
17 FI | |
18 WUNT f | |
19 FI | |
20 REM} ]?" | |
21 " |