Rebol ![]() |
http://www.rebol.com |
Factorial (1) | chaz |
fact: func [nummer]
[either equal? nummer 1
[1]
[multiply nummer fact subtract nummer 1]
]
fact 6
|
Calculates the factorial. Results
720 . |
Factorial (2) | chaz |
factorial: func [num][ fact: func [n a] [ any [ if lesser? n 0 [0] switch n [0 1 a] fact subtract n 1 multiply n a ] ] fact num 1 ] factorial 6 |
Calculates the factorial. Results
720 . |
Hello World | Michael Neumann |
print "Hello World"
|
Prints "Hello World" onto the
screen. |
Squares (1) | Michael Neumann |
repeat i 10 [prin i * i prin " "] |
Outputs the squares from 1 to
10. |
Squares (2) | Michael Neumann |
for i 1 10 1 [prin i * i prin " "] |
Outputs the squares from 1 to
10. |
Squares (3) | chaz |
print repeat i 10 [append [] multiply i i]
|
Outputs the squares from 1 to
10. |