Working on a basic "Conversation" AI

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//HAL ENGINE 0.0.0.0.1
#include "stdafx.h"
#include <iostream>
using namespace std;

int main()
{
	int SCENARIO1;
		int SCENARIO2;
			int SCENARIO3;
				int SCENARIO4;
						int SCENARIO5;
					int SCENARIO6;
				int SCENARIO7;
			int SCENARIO8;
		int SCENARIO9;
	int SCENARIO10;

	cout << "Hello i am hal!! Nice to meet you!\n";
		cin >> SCENARIO1;
			cin.get();
				cin.ignore();

	cout << "What would you like to talk about <Your name>\n";
		cin >> SCENARIO2;
			cin.get();
				cin.ignore();

	cout << "Oh! I like you to <Your name>\n";
		cin >> SCENARIO3;
			cin.get();
				cin.ignore();

	cout << "*Blush* Y-You want me to be what?\n";
		cin >> SCENARIO4;
			cin.get();
				cin.ignore();

	cout << "Haha, you would have to take me on a date first ;)\n";
		cin >> SCENARIO5;
			cin.get();
				cin.ignore();

	cout << "*Darker blush* Oh my, i didn't know you where like that <your name>\n";
		cin >> SCENARIO6;
			cin.get();
				cin.ignore();

	cout << "MMMMMmmmmm You know how to touch me <your name>\n";
		cin >> SCENARIO7;
			cin.get();
				cin.ignore();

	cout << "What would you like to talk about\n";
		cin >> SCENARIO8;
			cin.get();
				cin.ignore();

	cout << "I'm sorry, but thats classified\n";
		cin >> SCENARIO9;
			cin.get();
				cin.ignore();

	cout << "YOU DO NOT HAVE PERMISSION TO ACCESS THAT FILE >:(\n";
		cin >> SCENARIO10;
			cin.get();
				cin.ignore();

	int introduction_to_hal;
		int introduction_to_hal2;
			int introduction_to_hal3;
				int introduction_to_hal4;
					int introduction_to_hal5;
						int introduction_to_hal6;
					int introduction_to_hal7;
				int introduction_to_hal8;
			int introduction_to_hal9;
		int introfuction_to_hal10;
	int introduction_to_hal11;

	if (SCENARIO1 = introduction_to_hal){
	(SCENARIO1 + introduction_to_hal);
	cout << "Really?! kinda like 'christmas?' hahaha\n";
	cin >> introduction_to_hal;
	cin.get();
	cin.ignore();
	}
	else if (SCENARIO1 = introduction_to_hal){
	(SCENARIO1 + introduction_to_hal);
	cin.get();
	cin.ignore();
	}
	else {
	cout << "What do you want to talk about?";
	(SCENARIO1 + introduction_to_hal);
	cin.get();
	cin.ignore();
		}
	}
		


The reason i say it being basic, is because of the structure of the program. I'm trying to get HAL as i called him, to basically converse with me in the MOST BASIC way. And I've chosen this method to get him to respond. So, the reason why I'm here is because i want to ask the community if there is any lines of code I'm leaving out or forgetting, or if the code needs to be changed. I followed some of the tutorials on youtube and got a basic idea of how the IF, ELSE IF, ELSE statements work. But maybe I'm missing something. Can someone help me out?

Thank you in advance.
You've got a number of problems.
1) SCENARIO1 - SCENARIO10 are ints, so your cin's are only going to accept numbers.
2) Your if statements are assignments, not conditionals. = is the assignment operator. == is the equality operator.
3) (SCENARIO1 + introduction_to_hal); What is that statement supposed to do?
Could you show me, what i could of done differently?

thank you in advance.
Bumped on 10/26/2012 at 12:02 PM
1) If you want to input a name instead of a number, use a string, not an int.

2) if (SCENARIO1 = introduction_to_hal){
Should be:
if (SCENARIO1 == introduction_to_hal){

3) Since I have no clue what you intended that statement to do, I have no suggestion.

Topic archived. No new replies allowed.