PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1class TRIANGLE
 2	-- Description of TRIANGLEs objects.
 3
 4feature {ANY}
 5	p1: POINT
 6			-- First point.
 7
 8	p2: POINT
 9			-- Second point.
10
11	p3: POINT
12			-- Third point.
13
14	make (a, b, c: POINT) is
15			-- To initialize the `Current' TRIANGLE.
16		do
17			p1 := a
18			p2 := b
19			p3 := c
20		end
21
22	translate (dx, dy: REAL) is
23			-- To translate the `Current' TRIANGLE.
24		do
25			p1.translate(dx, dy)
26			p2.translate(dx, dy)
27			p3.translate(dx, dy)
28		end
29
30end -- class TRIANGLE