diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2019-08-30 18:49:24 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-30 18:49:24 +0100 |
| commit | 887c31c0ef2ef5e5dcf151d95c6304ceafa883df (patch) | |
| tree | d7783727bca3afe9ed34c91004112439060ef7ce /challenge-023/roger-bell-west/postscript/ch-2.ps | |
| parent | 2505b4187fa8d57aa9c3c440bd3d31ca28840076 (diff) | |
| parent | 58fb751e6c0ae0b90f487db979916007a07c0192 (diff) | |
| download | perlweeklychallenge-club-887c31c0ef2ef5e5dcf151d95c6304ceafa883df.tar.gz perlweeklychallenge-club-887c31c0ef2ef5e5dcf151d95c6304ceafa883df.tar.bz2 perlweeklychallenge-club-887c31c0ef2ef5e5dcf151d95c6304ceafa883df.zip | |
Merge pull request #573 from Firedrake/rogerbw-challenge-023-ps
An entry in PostScript. NeilB made me do it.
Diffstat (limited to 'challenge-023/roger-bell-west/postscript/ch-2.ps')
| -rw-r--r-- | challenge-023/roger-bell-west/postscript/ch-2.ps | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/challenge-023/roger-bell-west/postscript/ch-2.ps b/challenge-023/roger-bell-west/postscript/ch-2.ps new file mode 100644 index 0000000000..6b4eb5f6f1 --- /dev/null +++ b/challenge-023/roger-bell-west/postscript/ch-2.ps @@ -0,0 +1,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 |
