Microsoft Small Basic

Program Listing: FSQ891
GraphicsWindow.Title = "Mahjong Tiles U+1F000 ~ U+1F02F"
pie[1] = "1=🀀;2=🀁;3=🀂;4=🀃;"
pie[2] = "1=🀆;2=🀅;3=🀄;"
pie[3] = "1=🀇;2=🀈;3=🀉;4=🀊;5=🀋;6=🀌;7=🀍;8=🀎;9=🀏;"
pie[4] = "1=🀐;2=🀑;3=🀒;4=🀓;5=🀔;6=🀕;7=🀖;8=🀗;9=🀘;"
pie[5] = "1=🀙;2=🀚;3=🀛;4=🀜;5=🀝;6=🀞;7=🀟;8=🀠;9=🀡;"
pie[6] = "1=🀢;2=🀣;3=🀤;4=🀥;"
pie[7] = "1=🀦;2=🀧;3=🀨;4=🀩;"
pie[8] = "1=🀪;2=🀫;"
fs = 200
GraphicsWindow.FontSize = fs
GraphicsWindow.BackgroundColor = "#222222"
GraphicsWindow.BrushColor = "White"
txt = Shapes.AddText("")
x = 50
y = 50
Shapes.Move(txt, x, y)
n = Array.GetItemCount(pie)
While "True"
For j = 0 To n
len = Array.GetItemCount(pie[j])
If j = 3 Then
GraphicsWindow.BrushColor = "Black"
GraphicsWindow.FillRectangle(x + fs * 0.05, y + fs * 0.05, fs * 0.9, fs * 0.425)
GraphicsWindow.BrushColor = "Red"
GraphicsWindow.FillRectangle(x + fs * 0.05, y + fs * 0.475, fs * 0.9, fs * 0.725)
ElseIf j = 4 Then
GraphicsWindow.BrushColor = "Green"
GraphicsWindow.FillRectangle(x + fs * 0.05, y + fs * 0.05, fs * 0.9, fs * 1.15)
ElseIf j = 5 Then
GraphicsWindow.BrushColor = "Navy"
GraphicsWindow.FillRectangle(x + fs * 0.05, y + fs * 0.05, fs * 0.9, fs * 1.15)
Else
GraphicsWindow.BrushColor = "Black"
GraphicsWindow.FillRectangle(x + fs * 0.05, y + fs * 0.05, fs * 0.9, fs * 1.15)
EndIf
For i = 1 To len
If j = 2 And i = 2 Then
GraphicsWindow.BrushColor = "Green"
GraphicsWindow.FillRectangle(x + fs * 0.05, y + fs * 0.05, fs * 0.9, fs * 1.15)
ElseIf j = 2 And i = 3 Then
GraphicsWindow.BrushColor = "Red"
GraphicsWindow.FillRectangle(x + fs * 0.05, y + fs * 0.05, fs * 0.9, fs * 1.15)
ElseIf j = 8 And i = 2 Then
GraphicsWindow.BrushColor = "Sienna"
GraphicsWindow.FillRectangle(x + fs * 0.05, y + fs * 0.05, fs * 0.9, fs * 1.15)
EndIf
Shapes.SetText(txt, pie[j][i])
Program.Delay(500)
EndFor
EndFor
EndWhile