aboutsummaryrefslogtreecommitdiff
path: root/challenge-023/roger-bell-west/postscript/ch-2.ps
blob: 6b4eb5f6f15862df1d92142a6e39adf84d4118d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
%! not DSC compliant, no rasterisation, run me where you can see %stdout

/ns 30 string def
/n input cvi def

/f 2 def

{
    n f mod 0 eq {
        /n n f idiv def
        (%stdout) (w) file
        dup f ns cvs writestring
        (\n) writestring
    }
    {
        f 2 eq {
            /f f 1 add def
        }
        {
            /f f 2 add def
        } ifelse
        f f mul n gt {
            exit
        } if
    } ifelse
} loop

(%stdout) (w) file
dup n ns cvs writestring
(\n) writestring
(%stdout) (w) file flushfile