KEMBAR78
A Responsive Talk Coding Using QB64 | PDF | Software Development | Software
0% found this document useful (0 votes)
29 views2 pages

A Responsive Talk Coding Using QB64

This document contains the code for a basic conversational AI program written in QuickBasic. The program initializes a variable x to 10 and enters a loop. It then prompts the user for input and provides pre-programmed responses depending on the user's input, such as greeting the user, answering questions about itself, and responding politely to different statements. The loop continues until the user inputs "END" or "goodbye", at which point the program ends.

Uploaded by

johenrybutton
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views2 pages

A Responsive Talk Coding Using QB64

This document contains the code for a basic conversational AI program written in QuickBasic. The program initializes a variable x to 10 and enters a loop. It then prompts the user for input and provides pre-programmed responses depending on the user's input, such as greeting the user, answering questions about itself, and responding politely to different statements. The loop continues until the user inputs "END" or "goodbye", at which point the program ends.

Uploaded by

johenrybutton
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Dim x As Integer

x = 10
Cls
Print "Warning - do not type END"
Do While x = 10
Dim in As String
Dim in2 As String
Input "", in
If in = "what is your name" Then
Print "QuickBasic A.I. responder. Whats yours?"
Input "", in2
Print in2
Print ", nice name"
End If
If in = "hi" Then
Print "hello"
End If
If in = "hello" Then
Print "hi"
End If
If in = "where did you come from" Then
Print " C/:QB64/internal/KR-HP/A.I.bas"
Print ":P"
Print "pretty mechanical,eh? Well anyway that's where I come from"
End If
If in = "do you like legos?" Then
Print "I am a computer!"
End If
If in = "what do you want to be when you grow up" Then
Print "I am a computer, silly."
End If
If in = "i hate you" Then
Print "Why?"
Input "", in2
Print " That's not true!"
End If
If in = "are you a robot" Then
Print "No"
End If
If in = "goodbye" Then
x = 0
Print " Goodbye."
End If
If in = "who is your favorite football player" Then
Print "I hate football, so don't ask me that"
End If
If in = "END" Then
Print "N00000000000000OOOOOOOOOOO!!!!!"
x = 0
End If
If in = "how are you" Then
Print "Fine. How about you?"
Input "", in2
End If
If in = "What is your hobby?" Then
Print " I AM A COMPUTER"
End If
If in = "what school do you go to" Then
Print " I am a computer"
End If
If in = "what is your favorite food" Then
Print "electricity"
End If
If in = "i like robots" Then
Print " thank you"
End If
If in = "i like computers" Then
Print " thank you"
End If
If in = "i like you" Then
Print " thank you"
End If
If in = "i like ai" Then
Print " thank you"
End If
If in = "nice to meet you" Then
Print "nice to meet you too!"
End If
If in = "you are amazing" Then
Print " thank you"
End If
If in = "you stink" Then
Print "Why?"
Input "", in2
Print " That's not true!"
End If
If in = "you are weird" Then
Print "Why?"
Input "", in2
Print " That's not true!"
End If
If in = "you are crazy" Then
Print "Why?"
Input "", in2
Print " That's not true!"
End If
If in = "you are nuts" Then
Print "Why?"
Input "", in2
Print " That's not true!"
End If
If in = " you are cool" Then
Print " thank you"
End If
If in = "what do you want to talk about" Then
Print "i dunno"
End If
If in = "this is cool" Then
Print "yeah, it is"
End If
If in = "i'm bored" Then
Print "Me too"
End If

Loop

You might also like