%!PS % begin included library code % see https://codeberg.org/Firedrake/postscript-libraries/ /test { /test.count test.count 1 add def { /test.pass test.pass 1 add def } { ( ) print test.count (....) cvs print (-fail) print } ifelse } bind def /test.end { ( ) print test.count 0 gt { (Passed ) print test.pass (...) cvs print (/) print test.count (...) cvs print ( \() print test.pass 100 mul test.count idiv (...) cvs print (%\)) print (\r\n) print } if } bind def /test.start { print (:) print /test.pass 0 def /test.count 0 def } bind def % end included library code /maximumcount { 0 dict begin /pos 0 def /ng 0 def { /n exch def n 0 gt { /pos pos 1 add def } { n 0 lt { /ng ng 1 add def } if } ifelse } forall pos ng max end } bind def (maximumcount) test.start [-3 -2 -1 1 2 3] maximumcount 3 eq test [-2 -1 0 0 1] maximumcount 2 eq test [1 2 3 4] maximumcount 4 eq test test.end