45 lines
861 B
Plaintext
45 lines
861 B
Plaintext
Type PPoint
|
|
x As Integer
|
|
y As Integer
|
|
End Type
|
|
|
|
Type CCircle
|
|
p As PPoint
|
|
r As Integer
|
|
End Type
|
|
|
|
Sub PointInit (pthis As PPoint Ptr, x0 As Integer, y0 As Integer)
|
|
pthis->x = x0
|
|
pthis->y = y0
|
|
End Sub
|
|
|
|
Sub CircleInit (pthis As CCircle Ptr, x0 As Integer, y0 As Integer, r0 As Integer)
|
|
pthis->p.x = x0
|
|
pthis->p.y = y0
|
|
pthis->r = r0
|
|
End Sub
|
|
|
|
Sub PointPrint (pthis As PPoint Ptr)
|
|
Print "Point at (" & pthis->x & ", " & pthis->y & ")"
|
|
End Sub
|
|
|
|
Sub CirclePrint (pthis As CCircle Ptr)
|
|
Print "Circle at center(" & pthis->p.x & ", " & pthis->p.y & "), radius " & pthis->r
|
|
End Sub
|
|
|
|
Dim As Integer i
|
|
Dim As PPoint points(3)
|
|
Dim As CCircle circles(4)
|
|
|
|
For i = 0 To 3
|
|
PointInit(@points(i), i, i+1)
|
|
PointPrint(@points(i))
|
|
Next
|
|
|
|
For i = 0 To 4
|
|
CircleInit(@circles(i), i, i+1, i+2)
|
|
CirclePrint(@circles(i))
|
|
Next
|
|
|
|
Sleep
|