RosettaCodeData/Task/Polymorphism/Inform-7/polymorphism.inf

20 lines
582 B
INI

Space is a room.
A point is a kind of thing.
A point has a number called X position.
A point has a number called Y position.
A circle is a kind of point.
A circle has a number called radius.
To print (P - point): say "Point: [X position of P], [Y position of P]."
To print (C - circle): say "Circle: [X position of C], [Y position of C] radius [radius of C]."
The origin is a point with X position 0 and Y position 0.
The circle of power is a circle with X position 100, Y position 25, radius 7.
When play begins:
print the origin;
print the circle of power;
end the story.