Microsoft Small Basic

Program Listing: FTQ210
' Stripes
' Version 0.1
' Copyright © 2016 Nonki Takahashi. The MIT License
'
GraphicsWindow.Title = "Stripes 0.1"
gw = 598
gh = 428
GraphicsWindow.Width = gw
GraphicsWindow.Height = gh
x1 = gw / 2 - gw / 4
x2 = gw / 2 + gw / 4
x3 = gw / 2
y1 = -gh / 10
y2 = -gh / 10
y3 = gh / 2
x4 = gw / 2 - gw / 6
x5 = gw / 2 + gw / 6
y4 = y3 + gh / 7
y5 = y3 + gh / 7
While "True"
n = Math.GetRandomNumber(2) + 1
For i = 1 To n
color[i] = GraphicsWindow.GetRandomColor()
width[i] = 4 * Math.GetRandomNumber(3)
EndFor
i = 1
x = 0
While x < gw
GraphicsWindow.BrushColor = color[i]
GraphicsWindow.FillRectangle(X, 0, width[i], gh)
x = x + width[i]
i = i + 1
If n < i Then
i = 1
EndIf
EndWhile
GraphicsWindow.BrushColor = "#66000000"
GraphicsWindow.FillTriangle(x1, y1, x2, y2, x3, y3)
GraphicsWindow.BrushColor = "White"
GraphicsWindow.FillTriangle(x1, y1, x4, y4, x3, y3)
GraphicsWindow.FillTriangle(x2, y2, x5, y5, x3, y3)
Program.Delay(2000)
EndWhile