Microsoft Small Basic

Program Listing: FDM232
GraphicsWindow.BackgroundColor = "Black"
GraphicsWindow.Width = Desktop.Width
GraphicsWindow.Height = Desktop.Height
Angle[1] = 97
Angle[2] = 41
Angle[3] = 73
Angle[4] = 35
Angle[5] = 0
Angle[6] = 20
Dist[1] = 40
Dist[2] = 120
Dist[3] = 80
Dist[4] = 60
Dist[5] = 100
Dist[6] = 20
Rate[1] = 10
Rate[2] = 6
Rate[3] = 1
Rate[4] = 9
Rate[5] = 5
Rate[6] = 10
Amount = Array.GetItemCount(Angle)
X[0] = GraphicsWindow.Width/2
Y[0] = GraphicsWindow.Height/2
For i = 1 To Amount
X[i] = X[i-1]+Dist[i]*Math.Cos(Math.GetRadians(Angle[i]))
Y[i] = Y[i-1]+Dist[i]*Math.Sin(Math.GetRadians(Angle[i]))
EndFor
X[Amount+1] = X[Amount]
Y[Amount+1] = Y[Amount]
While 1=1
For i = 1 To Amount
Shapes.Remove(Line[i])
Angle[i] = Angle[i]+Rate[i]
X[i] = X[i-1]+Dist[i]*Math.Cos(Math.GetRadians(Angle[i]))
Y[i] = Y[i-1]+Dist[i]*Math.Sin(Math.GetRadians(Angle[i]))
GraphicsWindow.PenColor = "Green"
Line[i] = Shapes.AddLine(X[i-1],Y[i-1],X[i],Y[i])
EndFor
GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor()
GraphicsWindow.DrawLine(X[Amount],Y[Amount],X[Amount+1],Y[Amount+1])
X[Amount+1] = X[Amount]
Y[Amount+1] = Y[Amount]
GraphicsWindow.DrawEllipse(X[Amount]-2.5,Y[Amount]-2.5,5,5)
Program.Delay(20)
EndWhile