home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Complete Encyclopedia of Games 3
/
GAMES1000V3_d2.iso
/
kids
/
mysto432
/
mysto432.fr_
/
mysto432.fr
Wrap
Text File
|
1997-07-20
|
15KB
|
456 lines
VERSION 5.00
Object = "{EF85CC23-AFDF-101D-85F5-6EBA1EE93AF4}#1.1#0"; "WAVE32.OCX"
Begin VB.Form frmMysto432
Appearance = 0 'Flat
BackColor = &H00C0C0C0&
BorderStyle = 3 'Fixed Dialog
Caption = " DR. MYSTO THE MINDREADER - A STUDY IN SEMI-ARTIFICIAL INTELLIGENCE V4.32 (7-16-97)"
ClientHeight = 6855
ClientLeft = 1065
ClientTop = 1350
ClientWidth = 9555
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Icon = "mysto432.frx":0000
LinkTopic = "Form1"
PaletteMode = 1 'UseZOrder
ScaleHeight = 6855
ScaleMode = 0 'User
ScaleWidth = 1006.319
Visible = 0 'False
Begin WaveLib.Wave Wave1
Left = 8160
Top = 480
_Version = 65537
_ExtentX = 847
_ExtentY = 847
_StockProps = 64
Exclusive = 0 'False
Filename = ""
FileLength = -1
Loop = 0 'False
PlayEnd = -1
PlayStart = -1
End
Begin VB.FileListBox FileBox
Appearance = 0 'Flat
ForeColor = &H000000FF&
Height = 1005
Left = 2280
Pattern = "*.brn"
TabIndex = 8
Top = 5880
Width = 1335
End
Begin VB.CommandButton cmdPlay
Appearance = 0 'Flat
Caption = "&Play"
Enabled = 0 'False
Height = 855
Left = 1080
TabIndex = 7
Top = 5880
Width = 855
End
Begin VB.Timer Delay
Left = 8160
Top = 3840
End
Begin VB.Timer Animation
Interval = 100
Left = 8160
Top = 3120
End
Begin VB.TextBox txtBox2
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
Height = 855
Left = 600
Locked = -1 'True
MultiLine = -1 'True
TabIndex = 0
TabStop = 0 'False
Text = "mysto432.frx":030A
Top = 2040
Width = 2295
End
Begin VB.PictureBox Pix2
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 5625
Left = 3323
Picture = "mysto432.frx":0355
ScaleHeight = 5625
ScaleMode = 0 'User
ScaleWidth = 3846.154
TabIndex = 6
Top = 0
Visible = 0 'False
Width = 3750
End
Begin VB.TextBox txtBox1
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
BorderStyle = 0 'None
ForeColor = &H000000C0&
Height = 195
Left = 2520
MultiLine = -1 'True
TabIndex = 5
Text = "mysto432.frx":178BB
Top = 6210
Width = 4575
End
Begin VB.PictureBox Pix1
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 5625
Left = 3323
Picture = "mysto432.frx":178D6
ScaleHeight = 5625
ScaleMode = 0 'User
ScaleWidth = 3846.154
TabIndex = 4
Top = 0
Width = 3750
End
Begin VB.CommandButton cmdQuit
Appearance = 0 'Flat
Caption = "&Quit"
Height = 855
Left = 120
TabIndex = 3
Top = 5880
Width = 855
End
Begin VB.CommandButton cmdNo
Appearance = 0 'Flat
Caption = "&No"
Enabled = 0 'False
Height = 855
Left = 8520
TabIndex = 2
Top = 5880
Width = 855
End
Begin VB.CommandButton cmdYes
Appearance = 0 'Flat
Caption = "&Yes"
Enabled = 0 'False
Height = 855
Left = 7560
TabIndex = 1
Top = 5880
Width = 855
End
Begin VB.Image Clock
Appearance = 0 'Flat
Height = 1455
Left = 7800
Picture = "mysto432.frx":2EE3C
Stretch = -1 'True
Top = 1320
Width = 1335
End
Begin VB.Line Line2
X1 = 303.317
X2 = 328.594
Y1 = 2640
Y2 = 3240
End
Begin VB.Line Line1
X1 = 278.041
X2 = 328.594
Y1 = 2880
Y2 = 3240
End
Begin VB.Shape Balloon
Height = 2055
Left = 120
Shape = 2 'Oval
Top = 1200
Width = 2895
End
End
Attribute VB_Name = "frmMysto432"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'Define Variables and Strings
Dim Question(10000) As String
Dim n, nn, Frame, Flag, KeyIn, Mouth, l, Clip, Voice As Integer
Dim Answer, Fraz, NewInfo, Hold As String
Dim NewQuestion, TASK, S1, S2, BrainName As String
Private Sub ADJUST()
'Add BINARY 11 to n & assign it to the word in Hold. Switch these two answers
If Answer = "Y" Then Question(n * 2 + 1) = Hold: Question(n * 2) = Question(n)
'Add BINARY 10 to n & assign it to the word in Hold. Switch these two answers
If Answer = "N" Then Question(n * 2) = Hold: Question(n * 2 + 1) = Question(n)
Question(n) = NewInfo 'Switch data position
If nn < n * 2 + 1 Then nn = n * 2 + 1 'Switch data #
'Save BRAIN
Mouth = 10 'Move mouth
Open BrainName For Output As #1 'Open Sequential file.
Print #1, nn 'Tell how many Questions
For n = 1 To nn 'Count until done
If Question(n) <> "" Then Print #1, n, Question(n) 'If not blank, save it
Next 'Do until there is no more
Close #1 'Turn off BRAIN
Yn_Off 'Turn the Yes/No buttons off
txtBox2 = "Thank you - I will add that WORD to my VOCABULARY" 'Print message
Wave1.filename = "Thank.wav"
Wave1.Action = Voice
Mouth = 10 'Move mouth
txtBox1.Enabled = False
txtBox1 = S2 'Print messages
n = 0
End Sub
Private Sub Animation_Timer()
If Mouth > 0 Then 'Speak if more than 0
Mouth = Mouth - 1 'Deincriment mouth by 1
If Frame = 1 Then
Pix2.Visible = True
Pix1.Visible = False 'Shut mouth
End If
If Frame = (-1) Then
Pix1.Visible = True
Pix2.Visible = False 'Open mouth
End If
Frame = Frame * (-1) 'Toggle Frame value
End If
End Sub
Private Sub Clock_Click()
txtBox2 = "This is Version 4. 32 bit Revision 1"
End Sub
Private Sub cmdNo_Click()
Answer = "N" 'The answer is no
If TASK = "GUESS" Then WRONGO 'Go to WRONGO
If TASK = "MAIN" Then n = n * 2: Main 'Add a BINARY 10 to n & ask next question.
If TASK = "ADJUST" Then ADJUST 'Go to ADJUST
End Sub
Private Sub cmdPlay_Click()
Cls 'Clear screen
Yn_On 'Turn on Yes/No buttons
Question(0) = "Think of a WORD and I will try to guess it, ready?" 'First question is READY?
Open BrainName For Input As #1
Input #1, nn
For n = 1 To nn
Input #1, n, Question(n)
Next
Close #1: txtBox1 = ""
n = 0 'Set question to 0
Main 'Start game
End Sub
Private Sub cmdQuit_Click()
End
End Sub
Private Sub cmdYes_Click()
Answer = "Y" 'The answer is yes
If TASK = "GUESS" Then RIGHTO 'Go to RIGHTO
If TASK = "MAIN" Then n = n * 2 + 1: Main 'Add a BINARY 11 to n & ask next question.
If TASK = "ADJUST" Then ADJUST 'Go to ADJUST
End Sub
Private Sub Delay_Timer()
txtBox2 = "......" + Question(n) + "...... "
If Delay.Interval = 3000 Then
Delay.Interval = 500
Exit Sub
End If
Wave1.filename = "AMI.wav"
Wave1.Action = Voice
Delay.Interval = 0
Mouth = 6
If Voice = 4 Then txtBox2 = "Am I right?"
End Sub
Private Sub FileBox_Click()
BrainName = FileBox.filename
FileBox.Visible = False
cmdPlay_Click
End Sub
Private Sub Form_Activate()
'Define Sentences
S1 = "Type a question that will help me tell "
S2 = "<-- Please select PLAY or QUIT"
Frame = 1: Voice = 1
Intro.Visible = False
End Sub
Private Sub Main()
If Question(n) = "***" Then 'Question is out of range
Wave1.filename = "nocheat.wav"
Wave1.Action = Voice
txtBox2 = "Sorry - It has to be ANIMAL, VEGETABLE or MINERAL"
TASK = "PLAY" 'Set Task to PLAY
Mouth = 10 'Move mouth
Yn_Off 'Turn off Yes/No buttons
txtBox1 = S2 'Print PLAY or QUIT
Exit Sub
End If
If Right$(Question(n), 1) <> "?" Then 'NOT a question
TASK = "GUESS" 'It is a GUESS
txtBox2 = "MMMM....I think your WORD is...."
Wave1.filename = "MMM.wav"
Wave1.Action = Voice
Delay.Interval = 3000 'Turn on Delay
Mouth = 24 'Move Mouth
Exit Sub
End If
l = Len(Question(n))
Clip = 0
If n = 0 Then Mouth = 50 Else Mouth = 8
If Voice = 1 Then
Fraz = Left$(Question(n), 5)
If Fraz = "IS IT" Then Fraz = "isit": Clip = 6
If Fraz = "IS HE" Then Fraz = "ishe": Clip = 6
If Fraz = "IS SH" Then Fraz = "issh": Clip = 6
If Fraz = "DOES " Then Fraz = "does": Clip = 7
On Error GoTo TRAP
Wave1.filename = Fraz + ".wav"
Wave1.Action = Voice
End If
txtBox2 = Right$(Question(n), l - Clip) 'Put question in Balloon
TASK = "MAIN" 'Set TASK to MAIN
Exit Sub
TRAP:
Print "There no wave file for " + Fraz
Print "Please make a wave file for it."
Fraz = "Null"
Resume
End Sub
Private Sub NEWCLUE()
'How can I tellthe new word from the old one?
Wave1.filename = "Typea.wav"
Wave1.Action = Voice
txtBox2 = S1 + NewInfo + " ...from... " + Question(n)
Hold = NewInfo 'Store new word in Hold temporarily
txtBox1 = "" 'Clear txtBox1
TASK = "VERIFY" 'Set TASK to VERIFY
End Sub
Private Sub Pix1_Click()
Voice = 4 'Voice off
End Sub
Private Sub RIGHTO()
Wave1.filename = "Righto.wav"
Wave1.Action = Voice
txtBox2 = "I AM RIGHT AGAIN!!!" 'Gloat for a while
txtBox1 = S2
Mouth = 12 'Move mouth
Yn_Off 'Turn Y/N buttons off
End Sub
Private Sub txtBox1_KeyPress(KeyIn As Integer)
KeyIn = Asc(UCase(Chr(KeyIn))) 'Convert to uppercase
NewInfo = txtBox1.Text 'Get NweInfo
If KeyIn = 13 Then 'If key is carriage return
KeyIn = 0 'Erase it.
'Go to where ever TASK sends you
If TASK = "NEWCLUE" Then NEWCLUE: Exit Sub
If TASK = "VERIFY" Then VERIFY: Exit Sub
End If
End Sub
Private Sub VERIFY()
Yn_On 'Turn Yes/No buttons on
'If the question has no '?' on the end put it on.
If Right$(NewInfo, 1) <> "?" Then NewInfo = NewInfo + "?"
'See if question matches answer.
txtBox2 = "Does the question " + NewInfo + " -describe - " + Hold + " ?"
TASK = "ADJUST" 'Set TASK to ADJUST
txtBox1.Enabled = False
Wave1.filename = "Well.wav"
Wave1.Action = Voice
End Sub
Private Sub WRONGO()
'I screwed up. What's your word?
txtBox2 = "I know I am close - Please tell me YOUR word.": Mouth = 10
Wave1.filename = "close.wav"
Wave1.Action = Voice
Yn_Off 'Turn off Yes/No buttons
txtBox1.Enabled = True 'Turn on txtBox1
txtBox1.SetFocus 'Open txtBox1 for input
TASK = "NEWCLUE" 'Set TASKfor NEWCLUE
End Sub
Private Sub Yn_Off()
cmdYes.Enabled = False 'Turn off Yes/No
cmdNo.Enabled = False
cmdQuit.Enabled = True 'Turn on Quit/Play buttons
cmdPlay.Enabled = True
txtBox1.Visible = True 'Show TxtBox1
End Sub
Private Sub Yn_On()
cmdYes.Enabled = True 'Turn Yes/No on & txtBox1 on
cmdNo.Enabled = True
txtBox1.Enabled = False 'Turn TxtBox1 off
cmdQuit.Enabled = False 'Turn Quit/Play buttons off
cmdPlay.Enabled = False
txtBox1.Visible = False 'Erase txtBox1
End Sub