Microsoft Small Basic

Program Listing: MHL183
' Sizes of Stars
' Copyright © 2016 Nonki Takahashi. The MIT License.
' References
' [1] National Astronomical Observatory of Japan 2015, Chronological Scientific Tables 2016.
' [2] Strand 1963, Basic Astr. Data.
' [3] Mozukewich et al. 2003, AJ, 126, 2502
' [4] Dyck et al. 1996, AJ, 111, 1705

GraphicsWindow.Title = "Sizes of Stars"
Init()
DrawStars()
Sub Init
star["Sun"] = "r=1.00;ET=5777;color=Ivory;"
star["α CMa A"] = "r=1.7;ET=10400;name=Sirius A;color=White;" ' [2],[3]
star["α Boo"] = "r=26;ET=4200;name=Arcturus;color=Yellow;" ' [3]
star["α Ori"] = "r=690;ET=3600;name=Betelgeuse;color=OrangeRed;" ' [4]
star["α Sco"] = "r=720;ET=3500;name=Antares;color=Red;" ' [3]
EndSub
Sub DrawStars
GraphicsWindow.BackgroundColor = "Black"
n = Array.GetItemCount(star)
index = Array.GetAllIndices(star)
x = 0
y = 100
For i = 1 To n
st = star[index[i]]
r = st["r"]
If st["name"] <> "" Then
name = st["name"]
Else
name = index[i]
EndIf
x = x + 80
GraphicsWindow.BrushColor = st["color"]
GraphicsWindow.DrawText(x, y - 20, name)
GraphicsWindow.FillEllipse(x - r / 3, y, 2 * r, 2 * r)
EndFor
EndSub