repl.it
@TheEggoCat/

iC-programming!

C++

First attempt at AI chatbot.

fork
loading
Files
  • main.cpp
  • NameSaver.txt
  • QuestionResponces.cpp
  • QuestionResponces.h
main.cpp
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
#include <iostream>
#include "unistd.h"
#include <string>
#include "QuestionResponces.h"
#include <fstream>
using namespace std;
string CBN;
string N;
string QT;
string Q;
responces R;
char Logo[20][40]
{
  "  ________        ____________________ ",
  " /_______/|      /___________________/|",
  "|       | |     |                   | |",
  "|  1.0  | |     |                   | |",
  "|       | |     |       ____________|/ ",
  "|_______|/      |       |  |           ",
  "                |       |  |           ",
  "  ________      |       |  |           ",
  " /_______/|     |       |  |           ",
  "|       | |     |       |  |           ",
  "|       | |     |       |  |__________ ",
  "|       | |     |       |_/__________/|",
  "|       | |     |                   | |",
  "|       | |     |                   | |",
  "|       | |     |___________________|/ ",
  "|       | |                            ",
  "|       | |                            ",
  "|       | |                            ",
  "|_______|/                             ",
  "           programing!                 "
};
void QS(){
  cout << "\n\n\n\n\n\n->What type of question do you have <" << N << ">, string, int, double, ect? (s/i/d/ect.)";
  cin >> QT;
  if (QT == "s"){
    cout << "\n\n\n\n\n\n->";
    cin >> Q;
    cout << R.SR(Q);
  }
  else {
    usleep(1000000);
    cout << "hmm. I don't believe I have this code in my data base...";
    cout << "\nHold on a moment while we fetch the error...";
    cout << "\n\n\n\nERROR/errorcode1/codenotavaliable";
    usleep(10000000);
  }
}
int main() {
  for (int i = 0; i < 20; i++){
    cout << Logo[i] << endl;
    usleep(100000);
  }
  cout << "\nPress enter to begin... ";
  cin.get();
  cout << "\nHello, Welcome to iC-programming! V1.0-future console AI, a simple program that is in verson 1.0 right now so may have a lack of functons, but feel free to ask anything (please add underscores where spaces would go). Press enter to continue... ";
  cin.get();
  cout << "\n\n\n\n\n\n->Please give me a name... ";
  cin >> CBN;
  ofstream NC;
  NC.open("NameSaver.txt");
  cout << "\nThat is a lovely name <" << CBN << ">. What is yours? ";
  cin >> N;
  NC <<"<"<<N<<">\n<"<<CBN<<">";
  NC.close();
  cout << "\nMe, <" << CBN << ">, likes that name <" << N << ">.\nFrom now on if you need to refer to me, please use my name, <" << CBN << ">.";
  while(1){
    QS();
  }
  return 0;
}
Fetching token
?