home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
451-475
/
apd465
/
programs
/
psychiatrist.amos
/
psychiatrist.amosSourceCode
Wrap
AMOS Source Code
|
1993-01-08
|
3KB
|
69 lines
' This program will listen to your problems and try to answer back.
'
' It works by searching for key words in the sentence and then responding
' back, depending on what words it found.
'
' Written by Brett George
'
Screen Open 0,640,256,2,$8000 : Colour 1,4095 : Cls Lowres
PR=26 : Randomize Timer
Dim PROBLEM$(PR)
Global R,PROBLEM$(),ANSW$,PR
For P=0 To PR : Read PROBLEM$(P) : Next
'
Data "hate","hostile","fear","aggressive","dislike","love","feel"
Data "angry","impress","like","unwell","sick","paranoid","phobia","scared"
Data "help","kill","murder","torture","helpless","lonely","frightend"
Data "no","you","killed","boring","tired"
'
Print : Under On : Centre "The Psychiatrist" : Under Off
Cmove -X Curs,2 : Input "What seems to be the problem? ";ANSW$
Do
ANSW$=Lower$(ANSW$) : CHECK_WORDS
Print : RESPOND : R=0
Input ANSW$
Loop
Procedure CHECK_WORDS
For P=0 To PR
If Len(ANSW$-PROBLEM$(P))<>Len(ANSW$)
R=P+1 : Exit
End If
Next
End Proc
Procedure RESPOND
If R=0
A=Rnd(2)
If ANSW$-" "=ANSW$
Print "What seems to be the problem with ";ANSW$+"?"
Pop Proc
End If
If A=0
Print "Is that right!"
End If
If A=1
Print "I'm afraid you'll have to be more specific."
End If
If A=2
Print "How 'bout describing your problem."
End If
End If
If R=1 Then Print "Why do you hate it so bad?"
If R=2 Then Print "What are you hostile about?"
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."
If R=4 Then Print "Why are you so agressive?"
If R=5 Then Print "Life's to short to worry about little things like that."
If R=6 Then Print "That's great you feel like that"
If R=7 Then Print "You shouldn't feel like that."
If R=8 Then Print "Why don't you calm down."
If R=9 Then Print "Do you really need to impress him/her so much."
If R=10 Then Print "That's great you like it so much."
If R=11 or R=12 Then Print "Maybe you should see a doctor."
If R=16 Then Print "You have come to the right place for help."
If R=17 or R=18 or R=19 or R=25 Then Print "There's no reason to be violent."
If R=20 Then Print "Why don't you try to defend yourself."
If R=21 Then Print "You should get out more."
If R=23 Then Print "Don't be so negative."
If R=24 Then Print "Don't blame me!"
If R=26 Then Print "Why do you find it so boring?"
If R=27 Then Print "Try getting some rest!"
End Proc