%!PS % begin included library code % see https://github.com/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.start { print (:) print /test.pass 0 def /test.count 0 def } 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 % end included library code /digitalclock { 2 dict begin /hhmm exch def hhmm (?) search { length /i exch def pop pop 1 { i 0 eq { hhmm 1 get 51 le { 2 } { 1 } ifelse exit } if i 1 eq { hhmm 0 get 50 lt { 9 } { 3 } ifelse exit } if i 3 eq { 5 exit } if i 4 eq { 9 exit } if 0 } repeat } { pop 0 } ifelse end } bind def (digitalclock) test.start (?5:00) digitalclock 1 eq test (?3:00) digitalclock 2 eq test (1?:00) digitalclock 9 eq test (2?:00) digitalclock 3 eq test (12:?5) digitalclock 5 eq test (12:5?) digitalclock 9 eq test test.end