Microsoft Small Basic

Program Listing: XFJ262
' mahreen miangul
' Fallinn Snow
' DecemBer 2016
GraphicsWindow.Width = 1288
GraphicsWindow.Height = 666
GraphicsWindow.BackgroundColor = "skyblue"
GraphicsWindow.PenColor = "darkslategray"
GraphicsWindow.DrawEllipse(-88,505,620,288)
GraphicsWindow.DrawEllipse(211,388,622,366)
GraphicsWindow.DrawEllipse(211,388,1888,666)
GraphicsWindow.brushColor = "tan"
GraphicsWindow.fillEllipse(-88,505,620,288)
GraphicsWindow.fillEllipse(211,388,622,366)
GraphicsWindow.fillEllipse(211,388,1888,666)

' Lake
GraphicsWindow.BrushColor = "SkyBlue"
GraphicsWindow.PenColor = "LightSlateGray"
SnowGlobe = Shapes.AddEllipse(600,200)
Shapes.Move(SnowGlobe,666,420)

' Shape Text
GraphicsWindow.FontSize = 44
GraphicsWindow.BrushColor= "Teal"
miangulBOX = Shapes.Addtext("mussa-maina")
Shapes.Move(miangulBOX, 10,10)
GraphicsWindow.FontSize = 55
GraphicsWindow.BrushColor= "indigo"
miangulBOX = Shapes.Addtext("mahreen miangul")
Shapes.Move(miangulBOX, 788,588)
GraphicsWindow.FontSize = 22

GraphicsWindow.Show()
shape_init() ' <--------- all shape data is input here!!
For M=1 to 6 ' <--------- you make 5 Cycles
ss=s[M] ' <--------- scale 5 data
N=1 ' <--------- shapes array index=1
for i=1 To 13 ' <------ max shape number is 6
GraphicsWindow.PenWidth = shape[N][i]["pw"]
GraphicsWindow.BrushColor = shape[N][i]["bc"]
GraphicsWindow.penColor = shape[N][i]["pc"]
If shape[N][i]["func"]="ell" Then
shp[N][i] = Shapes.AddEllipse(shape[N][i]["width"]*ss, shape[N][i]["height"]*ss)
ElseIf shape[N][i]["func"]="rect" Then
shp[N][i] = Shapes.AddRectangle(shape[N][i]["width"]*ss, shape[N][i]["height"]*ss)
ElseIf shape[N][i]["func"]="tri" Then
shp[N][i] = Shapes.Addtriangle(shape[N][i]["x1"]*ss, shape[N][i]["y1"]*ss,shape[N][i]["x2"]*ss, shape[N][i]["y2"]*ss, shape[N][i]["x3"]*ss, shape[N][i]["y3"]*ss)
ElseIf shape[N][i]["func"]="line" Then
shp[N][i] = Shapes.Addline(shape[N][i]["x1"]*ss, shape[N][i]["y1"]*ss,shape[N][i]["x2"]*ss, shape[N][i]["y2"]*ss)
EndIf
Shapes.Animate(shp[N][i], shape[N][i]["x"]*ss+shX[M], shape[N][i]["y"]*ss+shY[M], 500) ' <---- shx[],shY[] M=1 to 5
Shapes.Rotate(shp[N][i], Shape[N][i]["angle"])
EndFor
endfor

' Panda
scale = 1
x0 = 166 * scale
y0 = 444 * scale
GraphicsWindow.PenWidth = 0
' Ears
GraphicsWindow.BrushColor = "Black"
oEarLeft = Shapes.AddEllipse(10 * scale, 7 * scale)
Shapes.Move(oEarLeft, x0, y0)
Shapes.Rotate(oEarLeft, -45)
oEarRight = Shapes.AddEllipse(10 * scale, 7 * scale)
Shapes.Move(oEarRight, x0 + 30 * scale, y0)
Shapes.Rotate(oEarRight, 45)
' Chest
GraphicsWindow.BrushColor = "Black"
oChest = Shapes.AddEllipse(40 * scale, 15 * scale)
Shapes.Move(oChest, x0, y0 + 28 * scale)
' Body
GraphicsWindow.BrushColor = "White"
oBody = Shapes.AddEllipse(50 * scale, 35 * scale)
Shapes.Move(oBody, x0 - 5 * scale, y0 + 40 * scale)
' Legs
GraphicsWindow.BrushColor = "Black"
oLegLeft = Shapes.AddEllipse(30 * scale, 15 * scale)
Shapes.Move(oLegLeft, x0 - 15 * scale, y0 + 58 * scale)
Shapes.Rotate(oLegLeft, 20)
oLegRight = Shapes.AddEllipse(30 * scale, 15 * scale)
Shapes.Move(oLegRight, x0 + 25 * scale, y0 + 58 * scale)
Shapes.Rotate(oLegRight, -20)
' Feets
GraphicsWindow.BrushColor = "#080808"
oFootLeft = Shapes.AddEllipse(25 * scale, 15 * scale)
Shapes.Move(oFootLeft, x0 - 10 * scale, y0 + 60.5 * scale)
Shapes.Rotate(oFootLeft, 5)
oFootRight = Shapes.AddEllipse(25 * scale, 15 * scale)
Shapes.Move(oFootRight, x0 + 25 * scale, y0 + 60.5 * scale)
Shapes.Rotate(oFootRight, -5)
' Sholders
GraphicsWindow.BrushColor = "Black"
oSholderLeft = Shapes.AddEllipse(30 * scale, 15 * scale)
Shapes.Move(oSholderLeft, x0 - 10 * scale, y0 + 33 * scale)
Shapes.Rotate(oSholderLeft, -60)
oSholderRight = Shapes.AddEllipse(30 * scale, 15 * scale)
Shapes.Move(oSholderRight, x0 + 20 * scale, y0 + 33 * scale)
Shapes.Rotate(oSholderRight, 60)
' Arms
GraphicsWindow.BrushColor = "#Black"
oArmLeft = Shapes.AddEllipse(20 * scale, 10 * scale)
Shapes.Move(oArmLeft, x0 - 5 * scale, y0 + 48.5 * scale)
Shapes.Rotate(oArmLeft, 20)
oArmRight = Shapes.AddEllipse(20 * scale, 10 * scale)
Shapes.Move(oArmRight, x0 + 25 * scale, y0 + 48.5 * scale)
Shapes.Rotate(oArmRight, -20)
' Face
GraphicsWindow.BrushColor = "White"
oFace = Shapes.AddEllipse(38 * scale, 32 * scale)
Shapes.Move(oFace, x0 + scale, y0)
' Nose
GraphicsWindow.BrushColor = "Black"
oNose = Shapes.AddTriangle(0, 0, 8 * scale, 0, 4 * scale, 3 * scale)
Shapes.Move(oNose, x0 + 16 * scale, y0 + 22 * scale)
' Eyes
GraphicsWindow.BrushColor = "Black"
GraphicsWindow.PenColor = "DimGray"
oEyeLeft = Shapes.AddEllipse(11 * scale, 7 * scale)
Shapes.Move(oEyeLeft, x0 + 7 * scale, y0 + 12 * scale)
Shapes.Rotate(oEyeLeft, -60)
GraphicsWindow.PenWidth = 1
oEyeLeft2 = Shapes.AddEllipse(4 * scale, 4 * scale)
Shapes.Move(oEyeLeft2, x0 + 12 * scale, y0 + 11 * scale)
GraphicsWindow.PenWidth = 0
oEyeRight = Shapes.AddEllipse(11 * scale, 7 * scale)
Shapes.Move(oEyeRight, x0 + 22 * scale, y0 + 12 * scale)
Shapes.Rotate(oEyeRight, 60)
GraphicsWindow.PenWidth = 1
oEyeRight2 = Shapes.AddEllipse(4 * scale, 4 * scale)
Shapes.Move(oEyeRight2, x0 + 24 * scale, y0 + 11 * scale)
GraphicsWindow.PenWidth = 0
' Mouth
GraphicsWindow.PenColor = "Black"
GraphicsWindow.PenWidth = 2
oMouthLeft = Shapes.AddLine(0, 1.5 * scale, 4 * scale, 0)
Shapes.Move(oMouthLeft, x0 + 16 * scale, y0 + 26.5 * scale)
oMouthRight = Shapes.AddLine(0, 0, 4 * scale, 1.5 * scale)
Shapes.Move(oMouthRight, x0 + 20 * scale, y0 + 26.5 * scale)

' X-Mas Tree
balls()
star()

graphicswindow.brushcolor = " lime"
GraphicsWindow.FillTriangle(30,244,144,80,244,244)
GraphicsWindow.FillTriangle(30,322,144,160,244,322)
GraphicsWindow.FillTriangle(30,422,144,180,244,422)
GraphicsWindow.BrushColor = "goldenrod"
GraphicsWindow.FillRectangle(120,422,33,99)
balls()
star()

Sub balls
GraphicsWindow.BrushColor="Red"'1
GraphicsWindow.PenColor="Red"
b1=Shapes.Addtext("m")
Shapes.Move(b1,140,370)
GraphicsWindow.BrushColor="orange"'2
GraphicsWindow.PenColor="orange"
b2=Shapes.Addtext("u")
Shapes.Move(b2,180,270)
GraphicsWindow.BrushColor="yellow"'3
GraphicsWindow.PenColor="yellow"
b3=Shapes.Addtext("s")
Shapes.Move(b3,211,393)
GraphicsWindow.BrushColor="green"'4
GraphicsWindow.PenColor="green"
b4=Shapes.Addtext("s")
Shapes.Move(b4,144,200)
GraphicsWindow.BrushColor="blue"'5
GraphicsWindow.PenColor="blue"
b5=Shapes.Addtext("a")
Shapes.Move(b5,140,110)
GraphicsWindow.BrushColor="indigo"'6
GraphicsWindow.PenColor="indigo"
b6=Shapes.Addtext("m")
Shapes.Move(b6,100,300)
GraphicsWindow.BrushColor="violet"'7
GraphicsWindow.PenColor="violet"
b7=Shapes.Addtext("a")
Shapes.Move(b7,44,393)
GraphicsWindow.BrushColor="yellowgreen"'8
GraphicsWindow.PenColor="yellowgreen"
b8=Shapes.Addtext("i")
Shapes.Move(b8,80,370)
GraphicsWindow.BrushColor="greenyellow"'9
GraphicsWindow.PenColor="greenyellow"
b9=Shapes.Addtext("n")
Shapes.Move(b9,120,250)
GraphicsWindow.BrushColor="tan"'10
GraphicsWindow.PenColor="tan"
b10=Shapes.Addtext("a")
Shapes.Move(b10,80,190)
''GraphicsWindow.BrushColor="brown"'11
'GraphicsWindow.PenColor="brown"
'b11=Shapes.AddEllipse(20,20)
'Shapes.Move(b11,177,344)
'GraphicsWindow.BrushColor="darkgreen"'12
'GraphicsWindow.PenColor="darkgreen"
'b12=Shapes.Addtext("m")
'Shapes.Move(b12,155,288)
'GraphicsWindow.BrushColor="royalblue"'13
'GraphicsWindow.PenColor="royalblue"
'b13=Shapes.Addtext("u")
'Shapes.Move(b13,177,244)
'GraphicsWindow.BrushColor="orangered"'14
'GraphicsWindow.PenColor="orangered"
'b14=Shapes.Addtext("s")
'Shapes.Move(b14,122,144)
'GraphicsWindow.BrushColor="blueviolet"'15
'GraphicsWindow.PenColor="blueviolet"
'b15=Shapes.Addtext("s")
'Shapes.Move(b15,122,344)
'GraphicsWindow.BrushColor="orangered"'16
'GraphicsWindow.PenColor="orangered"
'b16=Shapes.Addtext("s")
'Shapes.Move(b16,122,144)
'GraphicsWindow.BrushColor="deeppink"'17
'GraphicsWindow.PenColor="deeppink"
'b17=Shapes.Addtext("a")
'Shapes.Move(b17,101,222)
'GraphicsWindow.BrushColor="lime"'18
'GraphicsWindow.PenColor="lime"
'b18=Shapes.Addtext("m")
'Shapes.Move(b18,122,488)
EndSub

Sub star
GraphicsWindow.BrushColor="Yellow"
GraphicsWindow.fillTriangle(145,60,135,80,155,80)
GraphicsWindow.FillTriangle(145,100,135,80,150,80)
GraphicsWindow.FillTriangle(125,80,145,70,145,90)
GraphicsWindow.FillTriangle(165,80,145,70,145,90)
EndSub

Sub shape_init
' Tree Data
'Tree 1
s[1]=.8
shX[1] = 255
shY[1] = 122
shape[1][1]="func=ell;X=0;Y=188;width=200;height=140;bc=Green;pc=Green;pw=2"
shape[1][2]="func=ell;X=10;Y=277;width=80;height=60;bc=Green;pc=Green;pw=2
shape[1][3]="func=ell;X=4;Y=255;width=80;height=70;bc=Green;pc=Green;pw=2
shape[1][4]="func=ell;X=0;Y=191;width=80;height=80;bc=Green;pc=Green;pw=2
shape[1][5]="func=ell;X=40;Y=177;width=80;height=80;bc=Green;pc=Green;pw=2
shape[1][6]="func=ell;X=100;Y=177;width=120;height=80;bc=Green;pc=Green;pw=2
shape[1][7]="func=ell;X=130;Y=240;width=100;height=80;bc=Green;pc=Green;pw=2
shape[1][8]="func=ell;X=130;Y=260;width=100;height=80;bc=Green;pc=Green;pw=2
shape[1][9]="func=rect;X=80;Y=322;width=60;height=100;bc=saddlebrown;pc=darkslatgray;pw=2
shape[1][10]="func=tri;X1=140;Y1=262;X2=110;Y2=322;X3=140;Y3=322;bc=saddlebrown;pc=darkslatgray;pw=0
shape[1][11]="func=tri;X1=140;Y1=262;X2=170;Y2=262;X3=140;Y3=322;bc=saddlebrown;pc=darkslatgray;pw=0
shape[1][12]="func=tri;X1=50;Y1=262;X2=96;Y2=262;X3=80;Y3=322;bc=saddlebrown;pc=darkslatgray;pw=0
shape[1][13]="func=tri;X1=96;Y1=262;X2=80;Y2=322;X3=126;Y3=322;bc=saddlebrown;pc=darkslatgray;pw=0
'Tree 2
s[2]=.8
shX[2] = 488
shY[2] = 88
'Tree 3
s[3]=.8
shX[3] = 711
shY[3] = 112
'Tree 4
s[4]=.8
shX[4] = 888
shY[4] = 88
'Tree 5
s[5]=.8
shX[5] = 1080
shY[5] = 111
'Tree 6
s[6]=.8
shX[6] = 988
shY[6] = 102


endsub
' Ducks
Shapes_Init()
s = .3
Shapes_Add()

Sub Shapes_Init
' Shapes | Initialize shapes data
' return shX, shY - current position of shapes
' return shape - array of shapes
shX = 988 ' x offset
shY = 488 ' y offset
shape = ""
shape[1] = "func=tri;x=153;y=41;x1=47;y1=0;x2=0;y2=22;x3=95;y3=22;bc=red;pw=0;beck"
shape[2] = "func=ell;x=118;y=0;width=91;height=73;bc=blue;pw=0;"
shape[3] = "func=line;x=172;y=36;x1=0;y1=0;x2=22;y2=0;pc=red;pw=2;blink"
shape[4] = "func=ell;x=172;y=25;width=22;height=22;bc=pink;pw=0;eye"
shape[5] = "func=tri;x=132;y=58;x1=31;y1=0;x2=0;y2=45;x3=62;y3=45;bc=red;pw=0;neck"
shape[6] = "func=tri;x=0;y=80;x1=37;y1=0;x2=0;y2=32;x3=75;y3=32;angle=178;bc=red;pw=0;tail"
shape[7] = "func=line;x=91;y=134;x1=0;y1=0;x2=0;y2=36;pc=red;pw=8;Leg1"
shape[8] = "func=ell;x=33;y=72;width=164;height=82;bc=yellow;pw=0;body"
shape[9] = "func=tri;x=58;y=180;x1=46;y1=0;x2=0;y2=14;x3=93;y3=14;bc=red;pw=0;Leg3"
shape[10] = "func=line;x=90;y=169;x1=0;y1=0;x2=14;y2=15;pc=yellow;pw=8;Leg2"
EndSub

Sub Shapes_Add
For i = 1 To Array.GetItemCount(shape)
GraphicsWindow.PenWidth = shape[i]["pw"]*s
GraphicsWindow.PenColor = shape[i]["pc"]
GraphicsWindow.BrushColor = shape[i]["bc"]
If shape[i]["func"] = "rect" Then
shape[i]["obj"] = Shapes.AddRectangle(shape[i]["width"]*s, shape[i]["height"]*s)
ElseIf shape[i]["func"] = "ell" Then
shape[i]["obj"] = Shapes.AddEllipse(shape[i]["width"]*s, shape[i]["height"]*s)
ElseIf shape[i]["func"] = "tri" Then
shape[i]["obj"] = Shapes.AddTriangle(shape[i]["x1"]*s, shape[i]["y1"]*s, shape[i]["x2"]*s, shape[i]["y2"]*s, shape[i]["x3"]*s, shape[i]["y3"]*s)
ElseIf shape[i]["func"] = "line" Then
shape[i]["obj"] = Shapes.AddLine(shape[i]["x1"]*s, shape[i]["y1"]*s, shape[i]["x2"]*s, shape[i]["y2"]*s)
EndIf
Shapes.Move(shape[i]["obj"], shX + shape[i]["x"]*s, shY + shape[i]["y"]*s)
Shapes.Rotate(shape[i]["obj"], shape[i]["angle"])
EndFor
EndSub


Shapes1_Init()
s = .3
Shapes1_Add()

Sub Shapes1_Init
' Shapes | Initialize shapes data
' return shX, shY - current position of shapes
' return shape - array of shapes
shX = 844 ' x offset
shY = 420 ' y offset
shape1 = ""
shape1[1] = "func=tri;x=153;y=41;x1=47;y1=0;x2=0;y2=22;x3=95;y3=22;bc=red;pw=0;beck"
shape1[2] = "func=ell;x=118;y=0;width=91;height=73;bc=blue;pw=0;"
shape1[3] = "func=line;x=172;y=36;x1=0;y1=0;x2=22;y2=0;pc=red;pw=2;blink"
shape1[4] = "func=ell;x=172;y=25;width=22;height=22;bc=pink;pw=0;eye"
shape1[5] = "func=tri;x=132;y=58;x1=31;y1=0;x2=0;y2=45;x3=62;y3=45;bc=red;pw=0;neck"
shape1[6] = "func=tri;x=0;y=80;x1=37;y1=0;x2=0;y2=32;x3=75;y3=32;angle=178;bc=red;pw=0;tail"
shape1[7] = "func=line;x=91;y=134;x1=0;y1=0;x2=0;y2=36;pc=red;pw=8;Leg1"
shape1[8] = "func=ell;x=33;y=72;width=164;height=82;bc=yellow;pw=0;body"
shape1[9] = "func=tri;x=58;y=180;x1=46;y1=0;x2=0;y2=14;x3=93;y3=14;bc=red;pw=0;Leg3"
shape1[10] = "func=line;x=90;y=169;x1=0;y1=0;x2=14;y2=15;pc=yellow;pw=8;Leg2"
EndSub

Sub Shapes1_Add
For i = 1 To Array.GetItemCount(shape1)
GraphicsWindow.PenWidth = shape1[i]["pw"]*s
GraphicsWindow.PenColor = shape1[i]["pc"]
GraphicsWindow.BrushColor = shape1[i]["bc"]
If shape1[i]["func"] = "rect" Then
shape1[i]["obj"] = Shapes.AddRectangle(shape1[i]["width"]*s, shape1[i]["height"]*s)
ElseIf shape[i]["func"] = "ell" Then
shape1[i]["obj"] = Shapes.AddEllipse(shape1[i]["width"]*s, shape1[i]["height"]*s)
ElseIf shape[i]["func"] = "tri" Then
shape1[i]["obj"] = Shapes.AddTriangle(shape1[i]["x1"]*s, shape1[i]["y1"]*s, shape1[i]["x2"]*s, shape1[i]["y2"]*s, shape1[i]["x3"]*s, shape1[i]["y3"]*s)
ElseIf shape[i]["func"] = "line" Then
shape1[i]["obj"] = Shapes.AddLine(shape1[i]["x1"]*s, shape1[i]["y1"]*s, shape1[i]["x2"]*s, shape1[i]["y2"]*s)
EndIf
Shapes.Move(shape1[i]["obj"], shX + shape1[i]["x"]*s, shY + shape1[i]["y"]*s)
Shapes.Rotate(shape1[i]["obj"], shape1[i]["angle"])
EndFor
EndSub

Snow()
Snowfalling()

Sub Snowfalling
For i=1 To 500
shapes.Animate(sSnow[i],Shapes.GetLeft(sSnow[i]),200+Math.GetRandomNumber(400),2000)
shapes.Animate(LSnow[i],Shapes.GetLeft(LSnow[i]),200+Math.GetRandomNumber(600),2000)
shapes.Animate(RSnow[i],Shapes.GetLeft(LSnow[i]),200+Math.GetRandomNumber(800),2000)
Program.Delay(200)
EndFor
EndSub

Sub Snow
GraphicsWindow.BrushColor="#E6EAE3"
For i=1 To 500
GraphicsWindow.FontSize=Math.GetRandomNumber(20)+2
sSnow[i]= Shapes.AddText("❅")
LSnow[i]= Shapes.AddText("❄")
RSnow[i]= Shapes.AddText("m")
shapes.Move(sSnow[i],Math.GetRandomNumber(1200),-100)
shapes.Move(LSnow[i],Math.GetRandomNumber(1200),-100)
shapes.Move(RSnow[i],Math.GetRandomNumber(1200),-100)
EndFor
EndSub