tasks a-s

This commit is contained in:
Ingy döt Net 2013-04-10 23:57:08 -07:00
parent 47bf37c096
commit b83f433714
12433 changed files with 156208 additions and 123 deletions

View file

@ -0,0 +1,73 @@
type mypoint(mypoint) embed export
embed
integer x
integer y
reference
function copy
function print
end type
function mypoint.new(mypoint me, integer x=0, integer y=0)
me.x = x
me.y = y
end function me
function mypoint.copy(mypoint me)
mypoint p
p =@ mypoint.new(me.x, me.y)
end function p
function mypoint.print(mypoint me)
end function "mypoint"
type circle(mypoint) embed export
reference
mypoint midpoint resolve
embed
integer radius
reference
function copy
function print
end type
function circle.new(circle me, integer x=0, integer y=0, integer radius=0, mypoint midpoint)
if midpoint =@= .nul
me.midpoint =@ mypoint.new(x, y)
else
me.x = midpoint.x
me.y = midpoint.y
end if
me.radius = radius
end function me
function circle.copy(circle me)
circle c
c =@ circle.new(radius=me.radius, midpoint=me.midpoint)
end function c
function circle.print(circle me)
end function "circle"
function main()
type(mypoint) p, c
string result
p =@ mypoint.new()
c =@ circle.new()
result = p.print() + "{d}{a}" + c.print() + "{d}{a}"
end function result