Skip to content

Instantly share code, notes, and snippets.

@adregan
Last active October 20, 2015 19:57
Show Gist options
  • Save adregan/439dc585f8f4e5fa68c8 to your computer and use it in GitHub Desktop.
Save adregan/439dc585f8f4e5fa68c8 to your computer and use it in GitHub Desktop.
#lang racket
; get-pieces : List Number String -> String
; will return a string of a given length(50) pieces shuffled repeating
; all the pieces within every x number of pieces
(define (get-pieces [pieces (list #\O #\I #\S #\Z #\L #\J #\T)] [length 50] [output ""])
(if (>= (string-length output) length)
(substring output 0 length)
(get-pieces pieces length (string-append (list->string (shuffle pieces)) output))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment