home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 451-475 / apd465 / programs / psychiatrist.amos / psychiatrist.amosSourceCode
AMOS Source Code  |  1993-01-08  |  3KB  |  69 lines

  1. ' This program will listen to your problems and try to answer back.
  2. '  
  3. ' It works by searching for key words in the sentence and then responding
  4. ' back, depending on what words it found.  
  5. '
  6. ' Written by Brett George
  7. '
  8. Screen Open 0,640,256,2,$8000 : Colour 1,4095 : Cls Lowres
  9. PR=26 : Randomize Timer
  10. Dim PROBLEM$(PR)
  11. Global R,PROBLEM$(),ANSW$,PR
  12. For P=0 To PR : Read PROBLEM$(P) : Next 
  13. '
  14. Data "hate","hostile","fear","aggressive","dislike","love","feel"
  15. Data "angry","impress","like","unwell","sick","paranoid","phobia","scared"
  16. Data "help","kill","murder","torture","helpless","lonely","frightend"
  17. Data "no","you","killed","boring","tired"
  18. '
  19. Print : Under On : Centre "The Psychiatrist" : Under Off 
  20. Cmove -X Curs,2 : Input "What seems to be the problem? ";ANSW$
  21. Do 
  22.    ANSW$=Lower$(ANSW$) : CHECK_WORDS
  23.    Print : RESPOND : R=0
  24.    Input ANSW$
  25. Loop 
  26. Procedure CHECK_WORDS
  27.    For P=0 To PR
  28.       If Len(ANSW$-PROBLEM$(P))<>Len(ANSW$)
  29.          R=P+1 : Exit 
  30.       End If 
  31.    Next 
  32. End Proc
  33. Procedure RESPOND
  34.    If R=0
  35.       A=Rnd(2)
  36.       If ANSW$-" "=ANSW$
  37.          Print "What seems to be the problem with ";ANSW$+"?"
  38.          Pop Proc
  39.       End If 
  40.       If A=0
  41.          Print "Is that right!"
  42.       End If 
  43.       If A=1
  44.          Print "I'm afraid you'll have to be more specific."
  45.       End If 
  46.       If A=2
  47.          Print "How 'bout describing your problem."
  48.       End If 
  49.    End If 
  50.    If R=1 Then Print "Why do you hate it so bad?"
  51.    If R=2 Then Print "What are you hostile about?"
  52.    If R=3 or R=13 or R=14 or R=15 or R=18 or R=22 Then Print "You have to learn to confront your fears."
  53.    If R=4 Then Print "Why are you so agressive?"
  54.    If R=5 Then Print "Life's to short to worry about little things like that."
  55.    If R=6 Then Print "That's great you feel like that"
  56.    If R=7 Then Print "You shouldn't feel like that."
  57.    If R=8 Then Print "Why don't you calm down."
  58.    If R=9 Then Print "Do you really need to impress him/her so much."
  59.    If R=10 Then Print "That's great you like it so much."
  60.    If R=11 or R=12 Then Print "Maybe you should see a doctor."
  61.    If R=16 Then Print "You have come to the right place for help."
  62.    If R=17 or R=18 or R=19 or R=25 Then Print "There's no reason to be violent."
  63.    If R=20 Then Print "Why don't you try to defend yourself."
  64.    If R=21 Then Print "You should get out more."
  65.    If R=23 Then Print "Don't be so negative."
  66.    If R=24 Then Print "Don't blame me!"
  67.    If R=26 Then Print "Why do you find it so boring?"
  68.    If R=27 Then Print "Try getting some rest!"
  69. End Proc