#!/usr/bin/env /friends/bin/postscript %1 1 30 %{ dup 15 mod 0 eq {(FizzBuzz)} %{ dup 3 mod 0 eq {(Fizz)} %{ dup 5 mod 0 eq {(Buzz)} %if} ifelse } ifelse = clear } %for %(.) print %1 5 string cvs print %(.) print % basic definition, makes the definitions less verbose. /. {bind def} bind def /let* {reverse {exch def} forall}. /reverse {{} exch {exch [3 1 roll aload pop]} forall}. % stacky functions /rup {3 1 roll}. % higher order thingies. /map { [ rup forall ] }. % [1 2 3 4] {1 add} map /fold {rup exch rdown forall}. %/reverse {{} {exch cons} fold}. % {} [1 2 3 4 5] {exch cons} forall /cvstr { 4 dict begin /elements exch def /len elements length def /str len string def /i 0 def { i len ge { exit } if str i %The element of the array, as a hexadecimal string. %If it exceeds 16#FF, this will fail with a rangecheck. elements i get cvi put /i i 1 add def } loop str end } def [10 8 8 98 32 2 4 5 10 ] dup length dict begin aload let* currentdict {pop} map end [2 4 8 16 32 95] cvstr print