Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Arrays/Lingo/arrays-1.lingo
Normal file
15
Task/Arrays/Lingo/arrays-1.lingo
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
a = [1,2] -- or: a = list(1,2)
|
||||
put a[2] -- or: put a.getAt(2)
|
||||
-- 2
|
||||
a.append(3)
|
||||
put a
|
||||
-- [1, 2, 3]
|
||||
a.deleteAt(2)
|
||||
put a
|
||||
-- [1, 3]
|
||||
a[1] = 5 -- or: a.setAt(1, 5)
|
||||
put a
|
||||
-- [5, 3]
|
||||
a.sort()
|
||||
put a
|
||||
-- [3, 5]
|
||||
11
Task/Arrays/Lingo/arrays-2.lingo
Normal file
11
Task/Arrays/Lingo/arrays-2.lingo
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
ba = bytearray(2, 255) -- initialized with size 2 and filled with 0xff
|
||||
put ba
|
||||
-- <ByteArrayObject length = 2 ByteArray = 0xff, 0xff >
|
||||
ba[1] = 1
|
||||
ba[2] = 2
|
||||
ba[ba.length+1] = 3 -- dynamically increases size
|
||||
put ba
|
||||
-- <ByteArrayObject length = 3 ByteArray = 0x1, 0x2, 0x3 >
|
||||
ba[1] = 5
|
||||
put ba
|
||||
-- <ByteArrayObject length = 3 ByteArray = 0x5, 0x2, 0x3 >
|
||||
Loading…
Add table
Add a link
Reference in a new issue