Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
24
Task/Arrays/XLISP/arrays.xlisp
Normal file
24
Task/Arrays/XLISP/arrays.xlisp
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
[1] (define a (make-vector 10)) ; vector of 10 elements initialized to the empty list
|
||||
|
||||
A
|
||||
[2] (define b (make-vector 10 5)) ; vector of 10 elements initialized to 5
|
||||
|
||||
B
|
||||
[3] (define c #(1 2 3 4 5 6 7 8 9 10)) ; vector literal
|
||||
|
||||
C
|
||||
[4] (vector-ref c 3) ; retrieve a value -- NB. indexed from 0
|
||||
|
||||
4
|
||||
[5] (vector-set! a 5 1) ; set a_5 to 1
|
||||
|
||||
1
|
||||
[6] (define d (make-array 5 6 7)) ; 3-dimensional array of size 5 by 6 by 7
|
||||
|
||||
D
|
||||
[7] (array-set! d 1 2 3 10) ; set d_1,2,3 to 10 -- NB. still indexed from 0
|
||||
|
||||
10
|
||||
[8] (array-ref d 1 2 3) ; and get the value of d_1,2,3
|
||||
|
||||
10
|
||||
Loading…
Add table
Add a link
Reference in a new issue