001.
Public
Class
Form1
002.
Private
iX
As
Integer
003.
Private
iY
As
Integer
004.
Private
count
As
Integer
005.
Dim
g
As
Graphics =
Me
.CreateGraphics
006.
Private
Sub
MakeGo(
ByVal
x
As
Integer
,
ByVal
y
As
Integer
)
007.
If
count
Mod
2 = 0
Then
008.
count = count + 1
009.
Dim
rect
As
New
Rectangle(x, y, 40, 45)
010.
Dim
circle_brush
As
New
SolidBrush(Color.White)
011.
g.FillEllipse(circle_brush, rect)
012.
Dim
circle_pen
As
New
Pen(Color.White, 5)
013.
g.DrawEllipse(circle_pen, rect)
014.
Else
015.
count = count + 1
016.
Dim
rect
As
New
Rectangle(x, y, 40, 45)
017.
Dim
circle_brush
As
New
SolidBrush(Color.Black)
018.
g.FillEllipse(circle_brush, rect)
019.
Dim
circle_pen
As
New
Pen(Color.Black, 5)
020.
g.DrawEllipse(circle_pen, rect)
021.
End
If
022.
End
Sub
023.
Private
Sub
Form1_MouseDown(
ByVal
sender
As
Object
,
ByVal
e
As
System.Windows.Forms.MouseEventArgs)
Handles
Me
.MouseDown
024.
iX = e.X
025.
iY = e.Y
026.
027.
If
iX < 50
And
iY > 0
And
iY < 55
Then
028.
MakeGo(10, 10)
029.
ElseIf
iX < 100
And
iY > 0
And
iY < 55
Then
030.
MakeGo(60, 10)
031.
ElseIf
iX < 150
And
iY > 0
And
iY < 55
Then
032.
MakeGo(110, 10)
033.
ElseIf
iX < 200
And
iY > 0
And
iY < 55
Then
034.
MakeGo(160, 10)
035.
ElseIf
iX < 250
And
iY > 0
And
iY < 55
Then
036.
MakeGo(210, 10)
037.
End
If
038.
039.
If
iX < 50
And
iY > 55
And
iY < 110
Then
040.
MakeGo(10, 65)
041.
ElseIf
iX < 100
And
iY > 55
And
iY < 110
Then
042.
MakeGo(60, 65)
043.
ElseIf
iX < 150
And
iY > 55
And
iY < 110
Then
044.
MakeGo(110, 65)
045.
ElseIf
iX < 200
And
iY > 55
And
iY < 110
Then
046.
MakeGo(160, 65)
047.
ElseIf
iX < 250
And
iY > 55
And
iY < 110
Then
048.
MakeGo(210, 65)
049.
End
If
050.
051.
If
iX < 50
And
iY > 110
And
iY < 165
Then
052.
MakeGo(10, 120)
053.
ElseIf
iX < 100
And
iY > 110
And
iY < 165
Then
054.
MakeGo(60, 120)
055.
ElseIf
iX < 150
And
iY > 110
And
iY < 165
Then
056.
MakeGo(110, 120)
057.
ElseIf
iX < 200
And
iY > 110
And
iY < 165
Then
058.
MakeGo(160, 120)
059.
ElseIf
iX < 250
And
iY > 110
And
iY < 165
Then
060.
MakeGo(210, 120)
061.
End
If
062.
063.
If
iX < 50
And
iY > 165
And
iY < 215
Then
064.
MakeGo(10, 175)
065.
ElseIf
iX < 100
And
iY > 165
And
iY < 215
Then
066.
MakeGo(60, 175)
067.
ElseIf
iX < 150
And
iY > 165
And
iY < 215
Then
068.
MakeGo(110, 175)
069.
ElseIf
iX < 200
And
iY > 165
And
iY < 215
Then
070.
MakeGo(160, 175)
071.
ElseIf
iX < 250
And
iY > 165
And
iY < 215
Then
072.
MakeGo(210, 175)
073.
End
If
074.
075.
If
iX < 50
And
iY > 215
And
iY < 270
Then
076.
MakeGo(10, 230)
077.
ElseIf
iX < 100
And
iY > 215
And
iY < 270
Then
078.
MakeGo(60, 230)
079.
ElseIf
iX < 150
And
iY > 215
And
iY < 270
Then
080.
MakeGo(110, 230)
081.
ElseIf
iX < 200
And
iY > 215
And
iY < 270
Then
082.
MakeGo(160, 230)
083.
ElseIf
iX < 250
And
iY > 215
And
iY < 270
Then
084.
MakeGo(210, 230)
085.
End
If
086.
087.
If
count > 24
Then
088.
MessageBox.Show(
"Total = "
+ count.ToString())
089.
End
If
090.
End
Sub
091.
Private
Sub
Form1_Paint(
ByVal
sender
As
Object
,
ByVal
e
As
System.Windows.Forms.PaintEventArgs)
Handles
Me
.Paint
092.
Dim
rec1
As
New
Rectangle(5, 5, 50, 55)
093.
Dim
brownpen
As
New
Pen(Color.White, 3)
094.
g.DrawRectangle(brownpen, rec1)
095.
Dim
rec3
As
New
Rectangle(55, 5, 50, 55)
096.
g.DrawRectangle(brownpen, rec3)
097.
Dim
rec4
As
New
Rectangle(105, 5, 50, 55)
098.
g.DrawRectangle(brownpen, rec4)
099.
Dim
rec5
As
New
Rectangle(155, 5, 50, 55)
100.
g.DrawRectangle(brownpen, rec5)
101.
Dim
rec6
As
New
Rectangle(205, 5, 50, 55)
102.
g.DrawRectangle(brownpen, rec6)
103.
104.
Dim
rec21
As
New
Rectangle(5, 60, 50, 55)
105.
g.DrawRectangle(brownpen, rec21)
106.
Dim
rec22
As
New
Rectangle(55, 60, 50, 55)
107.
g.DrawRectangle(brownpen, rec22)
108.
Dim
rec23
As
New
Rectangle(105, 60, 50, 55)
109.
g.DrawRectangle(brownpen, rec23)
110.
Dim
rec24
As
New
Rectangle(155, 60, 50, 55)
111.
g.DrawRectangle(brownpen, rec24)
112.
Dim
rec25
As
New
Rectangle(205, 60, 50, 55)
113.
g.DrawRectangle(brownpen, rec25)
114.
115.
Dim
rec31
As
New
Rectangle(5, 115, 50, 55)
116.
g.DrawRectangle(brownpen, rec31)
117.
Dim
rec32
As
New
Rectangle(55, 115, 50, 55)
118.
g.DrawRectangle(brownpen, rec32)
119.
Dim
rec33
As
New
Rectangle(105, 115, 50, 55)
120.
g.DrawRectangle(brownpen, rec33)
121.
Dim
rec34
As
New
Rectangle(155, 115, 50, 55)
122.
g.DrawRectangle(brownpen, rec34)
123.
Dim
rec35
As
New
Rectangle(205, 115, 50, 55)
124.
g.DrawRectangle(brownpen, rec35)
125.
126.
Dim
rec41
As
New
Rectangle(5, 170, 50, 55)
127.
g.DrawRectangle(brownpen, rec41)
128.
Dim
rec42
As
New
Rectangle(55, 170, 50, 55)
129.
g.DrawRectangle(brownpen, rec42)
130.
Dim
rec43
As
New
Rectangle(105, 170, 50, 55)
131.
g.DrawRectangle(brownpen, rec43)
132.
Dim
rec44
As
New
Rectangle(155, 170, 50, 55)
133.
g.DrawRectangle(brownpen, rec44)
134.
Dim
rec45
As
New
Rectangle(205, 170, 50, 55)
135.
g.DrawRectangle(brownpen, rec45)
136.
137.
Dim
rec51
As
New
Rectangle(5, 225, 50, 55)
138.
g.DrawRectangle(brownpen, rec51)
139.
Dim
rec52
As
New
Rectangle(55, 225, 50, 55)
140.
g.DrawRectangle(brownpen, rec52)
141.
Dim
rec53
As
New
Rectangle(105, 225, 50, 55)
142.
g.DrawRectangle(brownpen, rec53)
143.
Dim
rec54
As
New
Rectangle(155, 225, 50, 55)
144.
g.DrawRectangle(brownpen, rec54)
145.
Dim
rec55
As
New
Rectangle(205, 225, 50, 55)
146.
g.DrawRectangle(brownpen, rec55)
147.
148.
End
Sub
149.
End
Class