FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
aviatorscript/examples/array.av at master · all-amazing/aviatorscript · GitHub
all-amazing
/
aviatorscript
Public
forked from
killme2008/aviatorscript
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
aviatorscript
/
examples
/
array.av
Copy path
More file actions
More file actions
Latest commit
History
History
History
50 lines (36 loc) · 805 Bytes
Breadcrumbs
aviatorscript
/
examples
/
array.av
Copy path
File metadata and controls
50 lines (36 loc) · 805 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
## examples/array.av
let a = seq.array(int, 1, 2, 3, 4);
println("type(a) is : " + type(a));
println("count(a) is: " + count(a));
let s = seq.array(java.lang.String, "hello", "world", "aviator");
println(string.join(s, ","));
let a = seq.array_of(int, 3);
println("type(a) is : #{type(a)}");
println("count(a) is: #{count(a)}");
println("before assignment:");
for x in a {
println(x);
}
for i in range(0, 3) {
a[i] = i;
}
println("after assignment:");
for x in a {
println(x);
}
## create multidimensional array
let a = seq.array_of(long, 3, 2);
assert(3 == count(a));
assert(2 == count(a[0]));
let x = 0;
for i in range(0, 3) {
for j in range(0, 2) {
a[i][j] = x;
x = x + 1;
}
}
for i in range(0, 3) {
for j in range(0, 2) {
p("a[#{i}][#{j}] = #{a[i][j]}");
}
}
Back
|
FazBrowse Home
|
New Git URL