WebL ![]() |
Factorial | Michael Neumann |
/* * Calculates the factorial */ var fac = fun(n) if n==1 or n==0 then 1 else n*fac(n-1) end end; PrintLn( fac(6) ); |
Calculates the factorial. Results
720 . |
Hello World | Michael Neumann |
// Hello World in WebL PrintLn("Hello World"); |
Prints "Hello World" onto the
screen. |
Squares (1) | Michael Neumann |
every i in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] do Print(i*i, " ") end |
Outputs the squares from 1 to
10. |
Squares (2) | Michael Neumann |
var i=1; repeat Print(i*i, " "); i=i+1 until i>10 end |
Outputs the squares from 1 to
10. |