fork download
  1. ; jumble
  2.  
  3. (define (jumble target)
  4. (let ((target (sort (string->list target) char<?)))
  5. (let loop ((word (read)))
  6. (unless (eof-object? word)
  7. (let ((signature (sort (string->list (symbol->string word)) char<?)))
  8. (if (equal? target signature) word (loop (read))))))))
  9.  
  10. (display (jumble "lteade")) (newline)
  11. (display (jumble "abcdef")) (newline)
Success #stdin #stdout 0.01s 50224KB
stdin
bishop
elated
travel
stdout
elated
#<unspecified>