home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Icon 8.1 / mep1 / Samples / Programs / shuffle.icn < prev    next >
Encoding:
Text File  |  1989-05-09  |  501 b   |  17 lines  |  [TEXT/PICN]

  1. ############################################################################
  2. #
  3. #  shuffle.icn
  4. #  
  5. #     The procedure shuffle(x) shuffles a string or list. In the case
  6. #  that x is a string, a corresponding string with the characters
  7. #  randomly rearranged is produced. In the case that x is a list,
  8. #  the values in the list are randomly rearranged.
  9. #  
  10. ############################################################################
  11.  
  12. procedure shuffle(x)
  13.     x := string(x)
  14.     every !x :=: ?x
  15.     return x
  16. end
  17.