Created
July 26, 2018 00:05
-
-
Save vishesh/8a3eaad120bd67b36278035f329b7d88 to your computer and use it in GitHub Desktop.
Random stupid conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #lang racket | |
| (define (conversation person-a person-b until) | |
| (let loop ([until until] | |
| [last-message-a ""] | |
| [last-message-b ""] | |
| [person-a person-a] | |
| [person-b person-b]) | |
| (let ([next-message-a (string-append "I didnt know that " last-message-a)] | |
| [next-message-b (string-append "you didnt know that " last-message-b)]) | |
| (displayln (string-append person-a ": " next-message-a "!")) | |
| (when (positive? until) | |
| (loop (sub1 until) | |
| next-message-b | |
| next-message-a | |
| person-b | |
| person-a))))) | |
| (conversation "Vishesh" "Vinay" 5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment