Microsoft Small Basic

Program Listing: HKX686-0
'DORAEMON
' mahreen miangul DeceMber 2018
' Nonki Takahashi 2016// FMT726-0
' Modified by Nonki Takahashi 2018// HKX686-0

GraphicsWindow.BackgroundColor = "oliveDrab

' Shadow
GraphicsWindow.Title = "mahreen miangul
GraphicsWindow.PenWidth = 12'
GraphicsWindow.PenColor = "yellow
param = "x=230;y=100;width=220;height=200;"
DrawEllipse()

' Face
GraphicsWindow.BrushColor = "royalblue
GraphicsWindow.FillEllipse(235, 100, 210, 190)
GraphicsWindow.PenColor = "royalblue
param = "x=235;y=100;width=210;height=190;"
DrawEllipse()

GraphicsWindow.BrushColor = "white
GraphicsWindow.FillEllipse(250, 130, 180, 130)
GraphicsWindow.PenColor = "white
param = "x=250;y=130;width=180;height=130;"
DrawEllipse()

' Collar
GraphicsWindow.PenWidth = 6
GraphicsWindow.PenColor = "black
param = "x1=250;y1=261;x2=430;y2=263;"
DrawLine()
GraphicsWindow.PenWidth = 14
GraphicsWindow.PenColor = "red
param = "x1=250;y1=253;x2=430;y2=253;"
DrawLine()
GraphicsWindow.BrushColor = "gold
GraphicsWindow.FillEllipse(333, 246, 20, 20)
GraphicsWindow.PenWidth = 6
GraphicsWindow.PenColor = "black
param = "x=333;y=246.5;width=20;height=20;"
Drawellipse()
GraphicsWindow.PenWidth = 2
GraphicsWindow.PenColor = "black
param = "x1=337;y1=257;x2=350;y2=257;"
DrawLine()
GraphicsWindow.PenWidth = 2
GraphicsWindow.PenColor = "black
param = "x1=343;y1=250;x2=343;y2=265;"
DrawLine()

' Eyes
GraphicsWindow.BrushColor = "white
GraphicsWindow.FillEllipse(308, 110, 35, 35)
GraphicsWindow.PenWidth = 4
GraphicsWindow.PenColor = "black
param = "x=308;y=110;width=35;height=35;"
Drawellipse()
GraphicsWindow.FillEllipse(346, 110, 35, 35)
param = "x=346;y=110;width=35;height=35;"
Drawellipse()
GraphicsWindow.BrushColor = "black
GraphicsWindow.FillEllipse(322, 125, 10, 10)
GraphicsWindow.PenWidth = 4
param = "x=322;y=125;width=10;height=10;"
Drawellipse()
GraphicsWindow.FillEllipse(353, 125, 10, 10)
param = "x=353;y=125;width=10;height=10;"
Drawellipse()

' mahreen miangul
' Left
GraphicsWindow.PenColor = "DimGray
GraphicsWindow.PenWidth = 4
param = "x1=277;y1=147;x2=330;y2=160;"
DrawLine()
param = "x1=266;y1=175;x2=330;y2=175;"
DrawLine()
param = "x1=270;y1=200;x2=330;y2=190;"
DrawLine()
' Right
param = "x1=353;y1=160;x2=410;y2=150;"
DrawLine()
param = "x1=353;y1=175;x2=420;y2=175;"
DrawLine()
param = "x1=353;y1=190;x2=415;y2=200;"
DrawLine()

' Tounge
GraphicsWindow.BrushColor = "red
GraphicsWindow.FillEllipse(368, 190, 20, 34)
GraphicsWindow.PenColor = "black
GraphicsWindow.PenWidth = 4
param = "x=368;y=190;width=20;height=34;"
DrawEllipse()

' Mouth
GraphicsWindow.PenColor = "black
GraphicsWindow.PenWidth = 6
param = "x=295;y=190;width=95;height=40;a1=0;a2=180;"
DrawArc()

' Nose
GraphicsWindow.PenWidth = 6
GraphicsWindow.PenColor = "black
GraphicsWindow.BrushColor = "black
param = "x1=341;y1=142;x2=341;y2=224;"
DrawLine()
GraphicsWindow.BrushColor = "red
GraphicsWindow.FillEllipse(335, 135, 15, 15)
GraphicsWindow.PenColor = "black"
param = "x=335;y=135;width=15;height=15;"
Drawellipse()

Sub DrawLine
pc = GraphicsWindow.PenColor
bc = GraphicsWindow.BrushColor
GraphicsWindow.BrushColor = pc
pw = GraphicsWindow.PenWidth
x1 = param["x1"]
y1 = param["y1"]
x2 = param["x2"]
y2 = param["y2"]
len = Math.SquareRoot((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1))
For k = 0 To 1 Step pw / len / 3
x = x1 * (1 - k) + x2 * k
y = y1 * (1 - k) + y2 * k
_dx = Math.GetRandomNumber(2) - 1
_dy = Math.GetRandomNumber(2) - 1
_pw = (Math.GetRandomNumber(2) / 10 + 0.9) * pw
GraphicsWindow.FillEllipse(x - _pw / 2 + _dx, y - _pw / 2 + _dy, _pw, _pw)
EndFor
GraphicsWindow.BrushColor = bc
EndSub

Sub DrawArc
pc = GraphicsWindow.PenColor
bc = GraphicsWindow.BrushColor
GraphicsWindow.BrushColor = pc
pw = GraphicsWindow.PenWidth
x = param["x"]
y = param["y"]
width = param["width"]
height = param["height"]
_a1 = param["a1"] * Math.Pi / 180
_a2 = param["a2"] * Math.Pi / 180
a = width / 2
b = height / 2
len = 2 * Math.Pi * Math.Max(a, b)
For θ = _a1 To _a2 Step pw / len * 3
_x = (x + a) + a * Math.Cos(θ)
_y = (y + b) + b * Math.Sin(θ)
_dx = Math.GetRandomNumber(2) - 1
_dy = Math.GetRandomNumber(2) - 1
_pw = (Math.GetRandomNumber(2) / 10 + 0.9) * pw
GraphicsWindow.FillEllipse(_x - _pw / 2 + _dx, _y - _pw / 2 + _dy, _pw, _pw)
EndFor
GraphicsWindow.BrushColor = bc
EndSub

Sub DrawEllipse
param["a1"] = 0
param["a2"] = 360
DrawArc()
EndSub