REXX ![]() |
similar languages: | ABC Amos BASIC Euphoria Profan | |
Hello World | Michael Neumann |
/* Hello World (Kommentar ist notwendig!!!) */ SAY "Hello World" |
Prints "Hello World" onto the
screen. |
Quicksort | H. Wonner |
Quicksort: PROCEDURE expose A. PARSE ARG lo, hi /* lo ist der unterste Index, hi ist der oberste Index des zu sortierenden (Teil-)Feldes A. */ /* Aufteilung */ i = lo j = hi Pivot = (lo + hi) % 2 x = a.Pivot Do Until i > j Do While a.i < x i = i + 1 end Do While a.j > x j = j - 1 end if i <= j then do h = a.i a.i = a.j a.j = h i = i + 1 j = j - 1 end end /* Rekursion */ if lo < j then call quicksort lo, j if i < hi then call quicksort i, hi Return 0 ^Z |
Quicksort sorting algorithm
|
Squares (1) | Michael Neumann |
/* */ DO I=1 TO 10 SAY I*I END |
Outputs the squares from 1 to
10. |
Squares (2) | Michael Neumann |
/* */ I=1 DO 10 SAY I*I I = I + 1 END |
Outputs the squares from 1 to
10. |