home *** CD-ROM | disk | FTP | other *** search
/ ftp.uni-stuttgart.de/pub/systems/acorn/ / Acorn.tar / Acorn / acornet / dev / hugs1.0.spk / hs / random < prev    next >
Text File  |  1995-02-14  |  306b  |  12 lines

  1. -- Generate a list of random numbers of length n
  2.  
  3. randoms :: Int -> [Int]
  4. randoms  = iterate (\seed-> (77*seed+1) `rem` 1024)
  5.  
  6. rand100  = sort (take 100 (randoms 1000))   -- a sample distribution
  7.  
  8. adjs []  = []                    -- a list of pairs of adjacent
  9. adjs xs  = zip xs (tail xs)            -- elements in a list
  10.  
  11.  
  12.