Code: Select all
MODULE Quiz;
VAR
a1*, a2*: ARRAY 1000 OF INTEGER;
i: INTEGER;
PROCEDURE Init*;
BEGIN
FOR i := 0 TO LEN(a1) - 1 DO
a1[i] := i;
a2[i] := i
END
END Init;
END Quiz.
1. You cannot use any IMPORT statements.
2. Your submitted code must compile without modification on any version v5.1 or later of any edition of Astrobe. (amended 12 Dec 2014)
3. When linked with the QuizTimer program below your code must run on any supported development board with at least 16K of RAM.
4. The interface as it appears to a client module must remain unchanged.
5. Your solution must be posted as a reply to this topic.
6. A maximum of two attempts per person are allowed.
7. If the execution time of two solutions are identical the prize will be awarded to the solution with the smallest generated code size.
8. If two solutions are identical in size and execution time the prize will be awarded to the one that was submitted earliest.
9. These conditions are subject to change if the need arises.
10. Any attempts considered to be cheating will be disqualified.
11. The judge's decision is final.
The closing time for entries is midnight GMT on 31st Dec 2014.
The following additional conditions apply to all entries received after 12 Noon GMT on 6 Dec 2014:
12. The generated code size of the compiled module must be no larger than the original.
13. No person can win more than one prize.
14. The program used to time the results is:
Code: Select all
MODULE QuizTimer;
IMPORT Out, Timer, Main, Quiz;
BEGIN
Timer.Init(Timer.uSecs);
Timer.Start();
Quiz.Init();
Out.Int(Timer.Elapsed(), 0);
Out.Ln
END QuizTimer.