Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/tests/nofib/real/compress/BinTest.hs

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


module Main (main) where

main = putStr (show (result 1000))

result 0 = []
result n = codes_to_ascii (3077, 1192) ++ result (n-1)

codes_to_ascii (x,y)
	= x_div : ((x_rem * 16) + y_div) : [y_rem]
          where
          (x_div, x_rem) = divRem x 16
          (y_div, y_rem) = divRem y 256

divRem x y = (x `div` y, x `rem` y) -- missing from PreludeCore ?

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].