\r\nclass Shape {\r\n has $.x;\r\n has $.y;\r\n method moveTo($newx, $newy) {\r\n $.x = $newx;\r\n $.y = $newy;\r\n }\r\n method rMoveTo($newx, $newy) {\r\n .moveTo($.x + $newx, $.y + $newy);\r\n }\r\n}\r\n\r\nclass Rectangle is Shape {\r\n has $.width is rw;\r\n has $.height is rw;\r\n method draw() {\r\n print "Drawing a Rectange at:($.x,$.y), width $.width, height $.height\\n";\r\n }\r\n}\r\n\r\nclass Circle is Shape {\r\n has $.radius;\r\n method draw() {\r\n print "Draw a Circle at:($.x,$.y), radius $.radius\\n";\r\n }\r\n}\r\n\r\n\r\n@scribble = (Rectangle.new(x=>10, y=>20, width=>5, height->6), Circle.new(x=>15, y=>25, radius=>8));\r\n\r\nfor @scribble -> $ashape {\r\n $ashape.draw;\r\n $ashape.rMoveTo(100, 100);\r\n $ashape.draw;\r\n}\r\n\r\n$arectangle = Rectangle.new(x=>0, y=>0, width=>15, height=>15);\r\n$arectangle.width = 30;\r\n$arectangle.draw;\r\n\r\nCheers,
\r\nBen