diff options
| -rw-r--r-- | challenge-023/roger-bell-west/postscript/ch-2.ps | 31 | ||||
| -rwxr-xr-x | challenge-023/roger-bell-west/postscript/ch2-ps-runme | 2 |
2 files changed, 33 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 diff --git a/challenge-023/roger-bell-west/postscript/ch2-ps-runme b/challenge-023/roger-bell-west/postscript/ch2-ps-runme new file mode 100755 index 0000000000..962de58b1a --- /dev/null +++ b/challenge-023/roger-bell-west/postscript/ch2-ps-runme @@ -0,0 +1,2 @@ +#! /bin/sh +gs -sinput=8347632417364218394 -- ch-2.ps |
