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,27 @@
MODULE TestArray;
(* Implemented in BlackBox Component Builder *)
IMPORT Out;
(* Static array *)
PROCEDURE DoOneDim*;
CONST M = 5;
VAR a: ARRAY M OF INTEGER;
BEGIN
a[0] := 100; (* set first element's value of array a to 100 *)
a[M-1] := -100; (* set M-th element's value of array a to -100 *)
Out.Int(a[0], 0); Out.Ln;
Out.Int(a[M-1], 0); Out.Ln;
END DoOneDim;
PROCEDURE DoTwoDim*;
VAR b: ARRAY 5, 4 OF INTEGER;
BEGIN
b[1, 2] := 100; (* second row, third column element *)
b[4, 3] := -100; (* fifth row, fourth column element *)
Out.Int(b[1, 2], 0); Out.Ln;
Out.Int(b[4, 3], 0); Out.Ln;
END DoTwoDim;
END TestArray.