Microsoft Small Basic

Program Listing: FHV760
' Simon 0.1a
' Simon clone for Small Basic written by Nonki Takahashi
'
' History:
' 0.1a 2013-12-05 Graphics designed for mask bitmap.
'
gw = 640
gh = 480
GraphicsWindow.Width = gw
GraphicsWindow.Height = gh
DrawBody()
Program.Delay(3000)
DrawMask()
DrawGrid()
Sub DrawBody
color = "1=Blue;2=Gold;3=Green;4=Red"
r2 = 200
x = "1=" + (gw / 2) + ";2=" + (gw / 2 - r2) + ";3=" + (gw / 2 - r2) + ";4=" + (gw / 2) + ";"
y = "1=" + (gh / 2) + ";2=" + (gh / 2) + ";3=" + (gh / 2 - r2) + ";4=" + (gh / 2 - r2) + ";"
For i = 1 To 4
GraphicsWindow.BrushColor = color[i]
GraphicsWindow.FillRectangle(x[i], y[i], r2, r2)
EndFor
r3 = 245
x3 = (gw - 2 * r3) / 2
y3 = (gh - 2 * r3) / 2
GraphicsWindow.PenColor = "White"
GraphicsWindow.PenWidth = 80
GraphicsWindow.DrawEllipse(x3, y3, 2 * r3, 2 * r3)
x2 = (gw - 2 * r2) / 2
y2 = (gh - 2 * r2) / 2
GraphicsWindow.PenColor = "Black"
GraphicsWindow.PenWidth = 20
GraphicsWindow.DrawEllipse(x2, y2, 2 * r2, 2 * r2)
GraphicsWindow.DrawLine(x2, gh / 2, gw - x2, gh / 2)
GraphicsWindow.DrawLine(gw / 2, y2, gw / 2, gh - y2)
r1 = 100
x1 = (gw - 2 * r1) / 2
y1 = (gh - 2 * r1) / 2
GraphicsWindow.BrushColor = "Black"
GraphicsWindow.FillEllipse(x1, y1, 2 * r1, 2 * r1)
GraphicsWindow.BrushColor = "White"
GraphicsWindow.FontSize = 50
xs = x1 + 22
ys = gh / 2 - 34
GraphicsWindow.DrawText(xs, ys, "Simon")
EndSub
Sub DrawMask
GraphicsWindow.BrushColor = "Black"
GraphicsWindow.FillEllipse(x2, y2, 2 * r2, 2 * r2)
GraphicsWindow.PenColor = "White"
GraphicsWindow.PenWidth = 90
GraphicsWindow.DrawEllipse(x3, y3, 2 * r3, 2 * r3)
r0 = 90
x0 = (gw - 2 * r0) / 2
y0 = (gh - 2 * r0) / 2
GraphicsWindow.BrushColor = "White"
GraphicsWindow.FillEllipse(x0, y0, 2 * r0, 2 * r0)
EndSub
Sub DrawGrid
GraphicsWindow.PenColor = "White"
GraphicsWindow.PenWidth = 2
For x = 120 To 620 Step 200
GraphicsWindow.DrawLine(x, 0, x, gh)
EndFor
For y = 40 To 440 Step 200
GraphicsWindow.DrawLine(0, y, gw, y)
EndFor
EndSub