home *** CD-ROM | disk | FTP | other *** search
- CLASS ARRTST
- FEATURE
- a: array[integer];
-
- create is
- local i:integer
- do
- a.create(1,10);
- io.putint(a.lower);
- io.putint(a.upper);
- from i:= a.lower
- invariant ForAll j: [a.lower .. i-1].a.item(j)=j
- variant a.upper - i + 1
- until i > a.upper
- loop
- a.put(i,i);
- i:=i+1
- end;
-
- io.new_line;
- from i:=a.upper
- variant i + a.lower + 1
- until i < a.lower
- loop
- io.putint(a.item(i));
- io.new_line;
- i:=i-1;
- end;
- end
- end
-
-
-