Strings for Experts

This page contains information about advanced topics that I have been asked.

Randomizing Letters of a String

The implode and explode functions change strings to and from lists of single letters. To randomize a list, import racket/list and then use the shuffle function. If you are actually looking at lists, you should change to Beginning Student with List Abbreviations.

(require picturing-programs)
(require racket/list)
(define (mix letters)
  (implode
   (shuffle
    (explode letters))))
(mix "alphabet soup")

Advanced String Making