File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ class
2+ CLOCKHANDS
3+
4+ create
5+ make
6+
7+ feature
8+
9+ make
10+ local
11+ t : INTEGER
12+ h : INTEGER
13+ m : INTEGER
14+ s : INTEGER
15+ do
16+ across 0 |..| 10 as i loop
17+ t := (43200 * i + 21600 ) // 11
18+ h := t // 3600
19+ m := t // 60 \\ 60
20+ s := t \\ 60
21+ if h = 0 then
22+ h := 12
23+ end
24+ print (pad (h ))
25+ print (" :" )
26+ print (pad (m ))
27+ print (" :" )
28+ print (pad (s ))
29+ print (" %N" )
30+ end
31+ end
32+
33+ feature
34+
35+ pad (n : INTEGER ): STRING
36+ do
37+ if n < 10 then
38+ Result := " 0" + n .out
39+ else
40+ Result := n .out
41+ end
42+ end
43+ end
Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ function Assert-MatchTests {
99}
1010
1111$Error.clear ()
12+ ec " $PSScriptRoot \clockhands.e" && . " $PSScriptRoot \clockhands.exe" |
13+ Compare-Object (Get-Content " $PSScriptRoot \..\test\clockhands_expected" ) |
14+ Assert-MatchTests &&
1215ec " $PSScriptRoot \hello.e" && . " $PSScriptRoot \hello.exe" &&
1316ec " $PSScriptRoot \triple.e" && . " $PSScriptRoot \triple.exe" |
1417 Compare-Object (Get-Content " $PSScriptRoot \..\test\triple_expected" ) |
You can’t perform that action at this time.
0 commit comments