Patt Function

Fills a list with a sequence of values


Description

The function Patt fills a new or an existing list with the values of the second argument.


Syntax

Patt (List, Pattern)

Patt (Length, Pattern)


Existing list

If a list is passed in the first parameter, its data is overwritten with the data sequence of the second parameter. The pattern repeats until the end of the list.

Example

a=[0,0,0,0,0,0,0,0,0,0,0,0]

Patt(a,[2,4,6])= 2 4 6 2 4 6 2 4 6 2 4 6

Patt([1..12],[2,4,6])= 2 4 6 2 4 6 2 4 6 2 4 6


New list

If a value is passed as the first argument, Patt creates a list of the specified length and fills it with the value of the second argument.

Example

Patt(10,[3,5,7])= 3 5 7 3 5 7 3 5 7 3