Pico ![]() |
http://pico.vub.ac.be/ |
Eulersche Number | Michael Neumann |
{ "Fakultät"; !n: if(n>1, n * !(n-1), 1); "Reziprok"; %n: 1 / n; e: 0; n: -1; lp[10]: { n := n+1; e := e + %(!n) }; "e ausgeben"; display(e) } |
Calculates the eulersche-number
(e=2.71828). |
Factorial | Michael Neumann |
{ fac(n): if(n>1, n*fac(n-1), 1); display( fac(6) ) } |
Calculates the factorial. Results
720 . |
Hello World | Michael Neumann |
{ "da es in Pico keine Kommentare gibt,"; "verwende ich einfach Strings."; display('Hello World', eoln) } |
Prints "Hello World" onto the
screen. |
Squares (1) | Michael Neumann |
for (i:1, i:=i+1, i<11, display(i^2, " ")) |
Outputs the squares from 1 to
10. |
Squares (2) | Michael Neumann |
{
n: 0;
t[10]: {n: n+1; n*n};
display(t)
}
|
Outputs the squares from 1 to
10. |