Microsoft Small Basic

Program Listing: HGS098
' Constant definition
MAG = 300
WIDTH = MAG * 2
HEIGHT = MAG * 1
STRIPE = WIDTH / 3
' Resize graphics window
GraphicsWindow.Title = "Mongolia"
GraphicsWindow.BackGroundColor = "#C4272F" ' red
GraphicsWindow.Width = WIDTH
GraphicsWindow.Height = HEIGHT
' Draw stripe
GraphicsWindow.BrushColor = "#015197" ' blue
x = STRIPE
y = 0
GraphicsWindow.FillRectangle(x, y, STRIPE, HEIGHT)
' Draw mark
DrawMark()
' End of program

Sub DrawMark
GraphicsWindow.BrushColor = "#F9CF02" ' yellow
x = MAG * 0.147
w = MAG * 0.087
y = MAG * 0.447
h = MAG * 0.4
GraphicsWindow.FillRectangle(x, y, w, h)
x = MAG * 0.433
GraphicsWindow.FillRectangle(x, y, w, h)
x1 = MAG * 0.25
y1 = MAG * 0.45
x2 = MAG * 0.417
y2 = MAG * 0.45
x3 = MAG * 0.333
y3 = MAG * 0.497
GraphicsWindow.FillTriangle(x1, y1, x2, y2, x3, y3)
y1 = MAG * 0.8
y2 = MAG * 0.8
y3 = MAG * 0.85
GraphicsWindow.FillTriangle(x1, y1, x2, y2, x3, y3)
x = MAG * 0.25
w = MAG * 0.167
y = MAG * 0.514
h = MAG * 0.033
GraphicsWindow.FillRectangle(x, y, w, h)
y = MAG * 0.747
GraphicsWindow.FillRectangle(x, y, w, h)
' Draw moon
x = MAG * 0.24
w = MAG * 0.187
y = MAG * 0.233
h = MAG * 0.2
GraphicsWindow.FillEllipse(x, y, w, h)
GraphicsWindow.BrushColor = "#C4272F" ' red
x = MAG * 0.231
w = MAG * 0.205
y = MAG * 0.177
h = MAG * 0.223
GraphicsWindow.FillEllipse(x, y, w, h)
' Draw fire
GraphicsWindow.BrushColor = "#F9CF02" ' yellow
x = MAG * 0.293
w = MAG * 0.081
y = MAG * 0.154
h = MAG * 0.079
GraphicsWindow.FillEllipse(x, y, w, h)
x = MAG * 0.299
w = MAG * 0.067
y = MAG * 0.131
h = MAG * 0.046
GraphicsWindow.FillEllipse(x, y, w, h)
GraphicsWindow.BrushColor = "#C4272F" ' red
x = MAG * 0.305
w = MAG * 0.053
y = MAG * 0.126
h = MAG * 0.04
GraphicsWindow.FillEllipse(x, y, w, h)
x = MAG * 0.308
w = MAG * 0.015
y = MAG * 0.175
h = MAG * 0.014
GraphicsWindow.FillEllipse(x, y, w, h)
x = MAG * 0.342
GraphicsWindow.FillEllipse(x, y, w, h)
x1 = MAG * 0.308
y1 = MAG * 0.182
x2 = MAG * 0.323
y2 = MAG * 0.182
x3 = MAG * 0.315
y3 = MAG * 0.150
GraphicsWindow.FillTriangle(x1, y1, x2, y2, x3, y3)
x1 = MAG * 0.342
x2 = MAG * 0.357
x3 = MAG * 0.353
GraphicsWindow.FillTriangle(x1, y1, x2, y2, x3, y3)
GraphicsWindow.BrushColor = "#F9CF02" ' yellow
x = MAG * 0.301
w = MAG * 0.012
y = MAG * 0.162
h = MAG * 0.012
GraphicsWindow.FillEllipse(x, y, w, h)
x = MAG * 0.355
w = MAG * 0.01
y = MAG * 0.16
h = MAG * 0.01
GraphicsWindow.FillEllipse(x, y, w, h)
GraphicsWindow.BrushColor = "#F9CF02" ' yellow
x = MAG * 0.318
w = MAG * 0.032
y = MAG * 0.135
h = MAG * 0.04
GraphicsWindow.FillEllipse(x, y, w, h)
x = MAG * 0.324
w = MAG * 0.016
y = MAG * 0.099
h = MAG * 0.024
GraphicsWindow.FillEllipse(x, y, w, h)
x1 = MAG * 0.336
y1 = MAG * 0.12
x2 = MAG * 0.32
y2 = MAG * 0.145
x3 = MAG * 0.349
y3 = MAG * 0.145
GraphicsWindow.FillTriangle(x1, y1, x2, y2, x3, y3)
x1 = MAG * 0.324
y1 = MAG * 0.112
x2 = MAG * 0.326
y2 = MAG * 0.136
x3 = MAG * 0.338
y3 = MAG * 0.123
GraphicsWindow.FillTriangle(x1, y1, x2, y2, x3, y3)
GraphicsWindow.BrushColor = "#C4272F" ' red
x = MAG * 0.328
w = MAG * 0.022
y = MAG * 0.097
h = MAG * 0.02
GraphicsWindow.FillEllipse(x, y, w, h)
x1 = MAG * 0.329
y1 = MAG * 0.109
x2 = MAG * 0.339
y2 = MAG * 0.122
x3 = MAG * 0.339
y3 = MAG * 0.109
GraphicsWindow.FillTriangle(x1, y1, x2, y2, x3, y3)
' Draw sun
GraphicsWindow.BrushColor = "#F9CF02" ' yellow
x = MAG * 0.267
w = MAG * 0.133
y = MAG * 0.25
h = MAG * 0.133
GraphicsWindow.FillEllipse(x, y, w, h)
' Draw ying-yang
x = MAG * 0.25
w = MAG * 0.167
y = MAG * 0.567
h = MAG * 0.167
GraphicsWindow.FillEllipse(x, y, w, h)
GraphicsWindow.BrushColor = "#C4272F" ' red
x = MAG * 0.317
w = MAG * 0.033
y = MAG * 0.59
h = MAG * 0.033
GraphicsWindow.FillEllipse(x, y, w, h)
y = MAG * 0.677
GraphicsWindow.FillEllipse(x, y, w, h)
pc = "#C4272F" ' red
pw = MAG * 0.006
cx = MAG * 0.333
cy = MAG * 0.607
r = MAG * 0.043
a1 = -90
a2 = 90
DrawArc()
cy = MAG * 0.693
a1 = 90
a2 = 270
DrawArc()
EndSub

Sub DrawArc
' param cx, cy - center
' param r - radius
' param a1, a2 - start and end angle [degree]
' param pw - pen width
' param pc - pen color
GraphicsWindow.BrushColor = pc
For a = a1 To a2
x = cx + r * Math.Cos(a * Math.Pi / 180) - pw / 2
y = cy + r * Math.Sin(a * Math.Pi / 180) - pw / 2
GraphicsWindow.FillEllipse(x, y, pw, pw)
EndFor
EndSub