mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 09:24:36 +00:00
19 lines
277 B
Nim
Executable File
19 lines
277 B
Nim
Executable File
# simple check for one dimensional arrays
|
|
|
|
type
|
|
TMyArray = array[0..2, int]
|
|
|
|
proc mul(a, b: TMyarray): TMyArray =
|
|
result = a
|
|
for i in 0..len(a)-1:
|
|
result[i] = a[i] * b[i]
|
|
|
|
var
|
|
x, y, z: TMyArray
|
|
|
|
x = [ 4, 5, 6 ]
|
|
y = x
|
|
echo repr(mul(x, y))
|
|
|
|
#OUT [16, 25, 36]
|