Advertisement
sezenspessa

godwords

Sep 3rd, 2018
878
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Racket 0.44 KB | None | 0 0
  1. #lang racket
  2.  
  3. (define (find word time)
  4.   (cond ((= time 0) (first word))
  5.         (else (find (cdr word) (- time 1)))))
  6.  
  7. (define words
  8.   (file->lines "words.txt"))
  9.  
  10. (define (main y z)
  11.   (cond ((= y 0) (printf "God says... ~s" z))
  12.         ((= y 1) (main (- y 1) (string-append z (find words (random (length words))))))
  13.          (else (main (- y 1) (string-append z (string-append (find words (random (length words))) " "))))))
  14.  
  15. (main 32 "")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement