| 1234567891011121314151617181920212223242526272829303132333435 | {-# LANGUAGE MultiWayIf #-}module Main whereimport Control.Monad (forM_)import Image.Pixelsimport qualified System.Random as Rglyph :: FilePath -> IO ()glyph fp = do  rs <- fmap R.randoms R.newStdGen  let (w, h) = (3, 3)      (fw, fh) = (w * 2 - 1, h * 2 - 1)  let img = scaleUp 16 $ image black (fw + 2) (fh + 2) $ do        forM_ (zip [1..fw ] (cycle [True,False])) $ \ (x, xConn) ->          forM_ (zip [1..fh] (cycle [True,False])) $ \ (y, yConn) ->          let color = if | xConn && yConn ->                             white                         | xConn || yConn ->                             if rs !! fromIntegral (x + fw * y)                               then black                               else white                         | otherwise ->                             black          in draw color x y  savePBM fp imgmain :: IO ()main = do  forM_ [0..15] $ \ n -> do    glyph ("glyph" ++ show n ++ ".pbm")
 |