| 1 |
// for loop ( factorial ) , -=>, *=> |
| 2 |
|
| 3 |
// function |
| 4 |
fun int factorial ( int arg ) |
| 5 |
{ |
| 6 |
1 => int r; |
| 7 |
arg => int b; |
| 8 |
for ( b ; b > 1 ; 1 -=> b ) |
| 9 |
{ |
| 10 |
b *=> r; |
| 11 |
} |
| 12 |
|
| 13 |
return r; |
| 14 |
} |
| 15 |
|
| 16 |
// call the function |
| 17 |
factorial ( 4 ) => int x; |
| 18 |
|
| 19 |
// test |
| 20 |
if ( x == 24 ) <<<"success">>>; |