> For the complete documentation index, see [llms.txt](https://gitbook.testingwaters.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.testingwaters.in/patterns/waves.md).

# Waves

#### Imperative

![](/files/-Lg-BoHQN_YANZpk1Sl3)

```d
def abc(a,b)
{
	ab = [Imperative]
	{
		y = [][];
		c = 0;
		d = 0;
		e = List.OfRepeatedItem(0,b);
		while (c<a)
		{
			f = Math.RandomList(b);
			while (d<b)
			{
				y[c][d] = f[d]+e[d];
				e[d] = y[c][d];
				d = d + 1;
			}
			c = c + 1;
			d = 0;
		}
		return = y;
	}
	e = Point.ByCoordinates((0..5..#a),ab<1>);
	f = NurbsCurve.ByControlPoints(e,3);
	return f;
};
```

#### Associative

![](/files/-Lg-Bsrpk4oGFvHuL2j7)

```d
rndLst1 = Math.RandomList(xCount*yCount);
rndLst2 = List.Chop(rndLst1,yCount);
rndLst3 = List.TakeItems(rndLst2<1>,1..yCount);
rndLst4 = Math.Sum(rndLst3);
nrbCrv1 = NurbsCurve.ByControlPoints(List.Transpose
(Point.ByCoordinates((0..5..#xCount),rndLst4)),3);
```
