'Set color to each line:
colors = "0=DarkRed;1=Red;2=Tomato;3=Cyan;4=DodgerBlue;5=Blue;6=Navy;7=DarkRed;"
colorsIndex = Array.GetItemCount(colors) - 1 '# of colors = # of lines to draw at each row
angleStep = 360/(colorsIndex+1) 'Set angle step diff. for all lines
'Main twister routine
Twist:
For ang=0 To angMax 'Angle loop
amp = Math.Sin(ang)*gh + twist 'Set the amplitude and change it based on gh & ang
For y=0 To gh Step sharp 'Row loop
calc = y/amp + ang 'Pre-calc
For line=0 To colorsIndex 'Line loop
x1 = Math.Sin(calc + angleStep*line )*size + set 'Set coordinates to draw each line
x2 = Math.Sin(calc + angleStep*(line+1))*size + set
If x1
GraphicsWindow.PenColor = colors[line]
GraphicsWindow.DrawLine(x1,y x2,y)
EndIf
EndFor
EndFor
'Delay before clearing the screen:
Program.Delay(delay)
GraphicsWindow.Clear()
EndFor