langs a-z

This commit is contained in:
Ingy döt Net 2013-04-10 22:43:41 -07:00
parent db842d013d
commit d066446780
11389 changed files with 98361 additions and 1020 deletions

View file

@ -0,0 +1,10 @@
/* NetRexx */
options replace format comments java crossref symbols binary
k_ = Rexx
bigDigits = 999999999 -- Maximum setting for digits allowed by NetRexx
numeric digits bigDigits
loop k_ = 1
say k_
end k_

View file

@ -0,0 +1,15 @@
/* NetRexx */
options replace format comments java crossref symbols binary
import java.math.BigInteger
-- allow an option to change the output radix.
parse arg radix .
if radix.length() == 0 then radix = 10 -- default to decimal
k_ = BigInteger
k_ = BigInteger.ZERO
loop forever
k_ = k_.add(BigInteger.ONE)
say k_.toString(int radix)
end

View file

@ -0,0 +1,4 @@
var i:int64 = 0
while true:
i = i + 1
echo(i)

View file

@ -0,0 +1,7 @@
let () =
let i = ref 0 in
while true do
print_int !i;
print_newline ();
incr i;
done

View file

@ -0,0 +1,7 @@
let () =
let rec aux i =
print_int i;
print_newline ();
aux (succ i)
in
aux 0

View file

@ -0,0 +1,11 @@
bundle Default {
class Count {
function : Main(args : String[]) ~ Nil {
i := 0;
do {
i->PrintLine();
i += 1;
} while(i <> 0);
}
}
}

View file

@ -0,0 +1,6 @@
DEF VAR ii AS INTEGER FORMAT "->>>>>>>>9" NO-UNDO.
DO WHILE TRUE:
ii = ii + 1.
DISPLAY ii.
END.

View file

@ -0,0 +1,6 @@
DEF VAR ii AS INT64 FORMAT "->>>>>>>>>>>>>>>>>>9" NO-UNDO.
DO WHILE TRUE:
ii = ii + 1.
DISPLAY ii.
END.

View file

@ -0,0 +1,6 @@
DEF VAR de AS DECIMAL FORMAT "->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>9" NO-UNDO.
DO WHILE TRUE:
de = de + 1.
DISPLAY de.
END.

View file

@ -0,0 +1,8 @@
#include <order/interpreter.h>
#define ORDER_PP_DEF_8printloop ORDER_PP_FN( \
8fn(8N, \
8do(8print(8to_lit(8N) 8comma 8space), \
8printloop(8inc(8N)))) )
ORDER_PP( 8printloop(1) )

View file

@ -0,0 +1,8 @@
#include <order/interpreter.h>
#define ORDER_PP_DEF_8printloop ORDER_PP_FN( \
8fn(8N, \
8do(8print(8to_lit(8N) 8comma 8space), \
8when(8less(8N, 99), 8printloop(8inc(8N))))) )
ORDER_PP( 8printloop(1) ) // 1, ..., 99,

View file

@ -0,0 +1 @@
n=0; while(1,print(++n))

View file

@ -0,0 +1,5 @@
infinity: procedure options (main);
declare k fixed decimal (30);
put skip edit
((k do k = 1 to 999999999999999999999999999998))(f(31));
end infinity;

View file

@ -0,0 +1,9 @@
Program IntegerSequenceLimited;
var
Number: QWord = 0; // 8 bytes, unsigned: 0 .. 18446744073709551615
begin
repeat
writeln(Number);
inc(Number);
until false;
end.

View file

@ -0,0 +1,15 @@
Program IntegerSequenceUnlimited;
uses
gmp;
var
Number: mpz_t;
begin
mpz_init(Number); //* zero now *//
repeat
mp_printf('%Zd' + chr(13) + chr(10), @Number);
mpz_add_ui(Number, Number, 1); //* increase Number *//
until false;
end.

View file

@ -0,0 +1 @@
.say for 1..*

View file

@ -0,0 +1 @@
1 {succ dup =} loop

View file

@ -0,0 +1,5 @@
OpenConsole()
Repeat
a.q+1
PrintN(Str(a))
ForEver

View file

@ -0,0 +1 @@
0 [ [ putn space ] sip 1+ dup 0 <> ] while drop

View file

@ -0,0 +1,4 @@
while 1
i = i + 1
print i
wend

View file

@ -0,0 +1,2 @@
iterate (i; [0...+oo])
i!;

View file

@ -0,0 +1,2 @@
for (i; 0; true)
i!;

View file

@ -0,0 +1,6 @@
variable i := 0;
while (true)
{
i!;
++i;
};

View file

@ -0,0 +1,11 @@
$ include "seed7_05.s7i";
const proc: main is func
local
var integer: number is 0;
begin
repeat
incr(number);
writeln(number);
until number = 2147483647;
end func;

View file

@ -0,0 +1,12 @@
$ include "seed7_05.s7i";
include "bigint.s7i";
const proc: main is func
local
var bigInteger: number is 1_;
begin
repeat
writeln(number);
incr(number);
until FALSE;
end func;

View file

@ -0,0 +1,4 @@
$$ MODE TUSCRIPT
LOOP n=0,999999999
n=n+1
ENDLOOP

View file

@ -0,0 +1,6 @@
#!/bin/sh
num=0
while true; do
echo $num
num=`expr $num + 1`
done

View file

@ -0,0 +1,3 @@
uint i = 0;
while (++i < uint.MAX)
stdout.printf("%u\n", i);

View file

@ -0,0 +1,3 @@
For i As Integer = 0 To Integer.MaxValue
Console.WriteLine(i)
Next

View file

@ -0,0 +1,8 @@
\Displays integers up to 2^31-1 = 2,147,483,647
code CrLf=9, IntOut=11;
int N;
[N:= 1;
repeat IntOut(0, N); CrLf(0);
N:= N+1;
until N<0;
]