Microsoft Small Basic

Program Listing: NGP714
txt[1] = "Merry Christmas"
txt[2] = "and a Happy New Year"
txt[3] = "from Small Basic"
gw = 500
gh = 500
GraphicsWindow.Width = gw
GraphicsWindow.Height = gh
GraphicsWindow.FontName = "Brush Script MT"
GraphicsWindow.FontSize = 40
GraphicsWindow.BackgroundColor = "Silver"
delay = 20

nrow = Array.GetItemCount(txt)
For j = 1 To Array.GetItemCount(txt)
y = (j-0.5)/(nrow+4)*gh
len = Text.GetLength(txt[j])
For i = 1 To Text.GetLength(txt[j])
x = i/(len+2)*gw
char = Text.GetSubText(txt[j],i,1)
GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor()
letter = Shapes.AddText(char)
Shapes.Animate(letter,x,y,delay)
Program.Delay(delay)
EndFor
EndFor

GraphicsWindow.BrushColor = "Green"
GraphicsWindow.FillTriangle(0.5*gw,0.5*gh,0.4*gw,0.7*gh,0.6*gw,0.7*gh)
GraphicsWindow.FillTriangle(0.5*gw,0.6*gh,0.375*gw,0.8*gh,0.625*gw,0.8*gh)
GraphicsWindow.FillTriangle(0.5*gw,0.7*gh,0.35*gw,0.9*gh,0.65*gw,0.9*gh)
GraphicsWindow.BrushColor = "Brown"
GraphicsWindow.FillRectangle(0.45*gw,0.9*gh,0.1*gw,0.09*gh)

col[1] = "Red"
col[2] = "Yellow"
col[3] = "Blue"
col[4] = "White"
colCount = Array.GetItemCount(col)
While ("True")
GraphicsWindow.BrushColor = col[Math.GetRandomNumber(colCount)]
GraphicsWindow.FillEllipse(0.5*gw-7,0.5*gh-7,14,14)
GraphicsWindow.FillEllipse(0.4*gw-7,0.7*gh-7,14,14)
GraphicsWindow.FillEllipse(0.6*gw-7,0.7*gh-7,14,14)
GraphicsWindow.FillEllipse(0.375*gw-7,0.8*gh-7,14,14)
GraphicsWindow.FillEllipse(0.626*gw-7,0.8*gh-7,14,14)
GraphicsWindow.FillEllipse(0.35*gw-7,0.9*gh-7,14,14)
GraphicsWindow.FillEllipse(0.65*gw-7,0.9*gh-7,14,14)
Program.Delay(20*delay)
EndWhile