Created
December 8, 2013 15:39
-
-
Save JohnEarnest/7859207 to your computer and use it in GitHub Desktop.
A very simple ELIZA-style psychotherapist program written in Loko-compatible Logo.
This file contains 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
to any :list | |
output item random size :list :list | |
end | |
to idle | |
output any [ | |
[Go on, go on.] | |
[What does that suggest to you?] | |
[How does that make you feel?] | |
] | |
end | |
to response :text :pairs | |
if empty? :pairs [output idle] | |
unless empty? | |
member first first :pairs :text [ | |
output butfirst first :pairs | |
] | |
output response :text butfirst :pairs | |
end | |
to converse | |
pr response readlist [ | |
[because Is that the real reason?] | |
[yes You seem quite positive.] | |
[not Why not? ] | |
] | |
converse | |
end | |
to eliza | |
pr [Hi, I'm Eliza. What seems to be the problem?] | |
converse | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment