Microsoft Small Basic

Program Listing: TFN794
man["x"] = GraphicsWindow.Width - 100
man = man + "head=24;neck=12;body=48;ab=-10;j1=48;j3=0;"
man = man + "l11=36;l12=36;l13=9;l14=12;"
man = man + "a11=-10;a12=30;a13=10;a14=-10;"
man = man + "l31=48;l32=48;l33=21;l34=7;"
man = man + "a31=10;a32=-20;a33=100;a34=0;"
man["y"] = GraphicsWindow.Height - 100
GraphicsWindow.BrushColor = "Black"
GraphicsWindow.PenColor = "Black"
man["oHead"] = Shapes.AddEllipse(man["head"], man["head"])
len = man["body"] + man["neck"] + man["head"] / 2
x0 = man["x"]
y0 = man["y"] - len
_ab = Math.GetRadians(man["ab"])
x = x0 + len * Math.Sin(_ab)
y = y0 - len * (Math.Cos(_ab) - 1)
Shapes.Move(man["oHead"], x - man["head"] / 2, y - man["head"] / 2)
len = man["body"]
man["oBody"] = Shapes.AddLine(0, 0, 0, len)
y0 = man["y"] - len
x = x0 + (len/2) * Math.Sin(_ab)
y = y0 - (len/2) * (Math.Cos(_ab) - 1)
Shapes.Move(man["oBody"], x, y)
Shapes.Rotate(man["oBody"], man["ab"])
For j = 1 To 3 Step 2
x0 = man["x"] + man["j"+j] * Math.Sin(_ab)
man["x"+j+0] = x0
y0 = man["y"] - man["j"+j] * Math.Cos(_ab)
man["y"+j+0] = y0
a = man["ab"]
For i = 1 To 4
len = man["l"+j+i]
man["oL"+j+i] = Shapes.AddLine(0, 0, 0, len)
a = a + man["a"+j+i]
_a = Math.GetRadians(a)
x = x0 - (len/2) * Math.Sin(_a)
y = y0 + (len/2) * (Math.Cos(_a) - 1)
Shapes.Move(man["oL"+j+i], x, y)
Shapes.Rotate(man["oL"+j+i], a)
x0 = x0 - len * Math.Sin(_a)
y0 = y0 + len * Math.Cos(_a)
EndFor
EndFor