new tasks
This commit is contained in:
parent
2a4d27cea0
commit
80737d5a6a
1194 changed files with 15353 additions and 1 deletions
12
Task/Arrays/Sather/arrays.sa
Normal file
12
Task/Arrays/Sather/arrays.sa
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
-- a is an array of INTs
|
||||
a :ARRAY{INT};
|
||||
-- create an array of five "void" elements
|
||||
a := #ARRAY{INT}(5);
|
||||
-- static creation of an array with three elements
|
||||
b :ARRAY{FLT} := |1.2, 1.3, 1.4|;
|
||||
-- accessing an array element
|
||||
c ::= b[0]; -- syntactic sugar for b.aget(0)
|
||||
-- set an array element
|
||||
b[1] := c; -- syntactic sugar for b.aset(1, c)
|
||||
-- append another array
|
||||
b := b.append(|5.5|);
|
||||
Loading…
Add table
Add a link
Reference in a new issue