We have said that a string is a sequence of characters. Nim also supports sequences, called seq, of an arbitrary type. For example, a sequence of integers is written with the notation seq[int], and a sequence of Point is seq[Point].
We want to be able to draw more than a single pixel. putPixels accomplishes that:
proc putPixels(points: seq[Point]; col: Color) = 1
for p in items(points): 2
pixels.putPixel p.x, p.y, col 3
putPixels(@[Point(x: 2, y: 3), Point(x: 5, y: 10)], Gold) 4
You can construct a sequence via @[...]. The empty sequence is @[]. Sequences offer random access, the i'ith element can be accessed via s[i]. The indexing starts from 0. The same notation is available for string.