Microsoft Small Basic

Program Listing: FCF037
' Olympic Flag
' Copyright (c) 2013 Nonki Takahashi. All rights reserved.
'
gh = 400
gw = gh / 2 * 3
GraphicsWindow.Title = "Olympic Flag"
GraphicsWindow.Width = gw
GraphicsWindow.Height = gh
w = gh / 30
r = gh / 6 - w / 2
GraphicsWindow.PenWidth = w
color = "1=#0067C0;2=#FFD400;3=#000000;4=#008000;5=#ED1A3D;"
x[1] = gw / 2 - 3 * r - 2 * w
y[1] = gh / 4 + w / 2
x[2] = gw / 2 - 2 * r - w
y[2] = gh / 4 + w / 2 + r
x[3] = gw / 2 - r
y[3] = gh / 4 + w / 2
x[4] = gw / 2 + w
y[4] = gh / 4 + w / 2 + r
x[5] = gw / 2 + r + 2 * w
y[5] = gh / 4 + w / 2
GraphicsWindow.PenWidth = 0
For a = -315 To 135
If a = 45 Then
a = 90
EndIf
_a = Math.GetRadians(a)
For i = 1 To 5
GraphicsWindow.BrushColor = color[i]
cx = x[i] + r
cy = y[i] + r
px = cx + r * Math.Cos(_a) - w / 2
py = cy + r * Math.Sin(_a) - w / 2
GraphicsWindow.FillEllipse(px, py, w, w)
EndFor
EndFor