/tutorial/triangle/version1/triangle.e
http://github.com/tybor/Liberty · Specman e · 30 lines · 18 code · 6 blank · 6 comment · 0 complexity · ee42868682efe392b50bf40a6a1b88a3 MD5 · raw file
- class TRIANGLE
- -- Description of TRIANGLEs objects.
- feature {ANY}
- p1: POINT
- -- First point.
- p2: POINT
- -- Second point.
- p3: POINT
- -- Third point.
- make (a, b, c: POINT) is
- -- To initialize the `Current' TRIANGLE.
- do
- p1 := a
- p2 := b
- p3 := c
- end
- translate (dx, dy: REAL) is
- -- To translate the `Current' TRIANGLE.
- do
- p1.translate(dx, dy)
- p2.translate(dx, dy)
- p3.translate(dx, dy)
- end
- end -- class TRIANGLE