How's my progress going, good?

First question is, if I did go off to code what would be the true advent AI (artificial intelligence), well, I without the A, would I choose the project "Console Application"?

Next question, I made all of the code below and learned everything in that code only in exactly 2 days time, and didn't know any of it yesterday, am I doing better than most?

The code below works:
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
// My c++ Legend
/* Contains
all */


#include <iostream>


using namespace std;

bool itsname2(int x, int y)
{
    return (x == y);
}

int main()
{
    cout << "Enter a number: ";
    int x;
    cin >> x;
    cout << "You entered " << x << endl;
    if (x > 10)
    {
        cout << x << " is greater than 10" << endl;
        cout << x << " is a big number" << endl;
        cout << "hi";
        cout << " there" << endl;
        if (x > 20)
        {
            cout << x << " is greater than 20" << endl;
        }
        else
        {
            cout << x << " is less than 20" << endl;
        }
    }
    else if (x < 10)
    {
        cout << x << " is less than 10" << endl;
    }
    else
    {
        cout << x << " is exactly 10" << endl;
    }
    int y;
    cout << "Enter a number: ";
    cin >> y;
    x = 5;
    x = x - 2;
    y = x;
    y = y + 4;
    cout << "You entered " << y << endl;
    cout << true << endl;
    cout << false << endl;
    cout << boolalpha;
    cout << true << endl;
    cout << false << endl;
    bool itsname(true);
    cout << itsname << endl;
    cout << !itsname << endl;

    cout << "Enter an integer: ";
    cin >> x;

    cout << "Enter another integer: ";
    cin >> y;

    bool equal = itsname2(x, y);
    if (equal)
    {
        cout << x << " and " << y << " are equal"<<endl;
    }
    else
    {
        cout << x << " and " << y << " are not equal"<<endl;
    }
    int age;
    const int usersAge (age);
    return 0;
}


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
#include <iostream>

void blahblah(void)
{
    std::cout << "step2" << std::endl;
}

int return6(int x, int y)
{
    return 6 + x + y;
}

int getValueFromUser()
{
    std::cout << "Enter an integer: ";
    int a;
    std::cin >> a;
    return a;
}

void printA()
{
    std::cout << "A" << std::endl;
}

void printB()
{
    std::cout << "B" << std::endl;
}

void printAB(int x, int y)
{
    printA();
    printB();
    std::cout << x << std::endl;
    std::cout << y << std::endl;
}

void writeansweragain(int x)
{
    std::cout << "The answer is " << x << std::endl;
}

int main()
{
    std::cout << "step1" << std::endl;
    blahblah();
    std::cout << "step3" << std::endl;
    std::cout << return6(2 * 4, 4) - 2 << std::endl;
    int x = getValueFromUser();
    int y = getValueFromUser();
    std::cout << x << " + " << y << " = " << x + y << std::endl;
    writeansweragain(x + y);
    printAB(6, 7);
    return 0;
}


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
// #include "stdafx.h" // uncomment if using visual studio
#include <iostream>
 
int getUserInput()
{
    std::cout << "Please enter an integer: ";
    int value;
    std::cin >> value;
    return value;
}
 
int getMathematicalOperation()
{
    std::cout << "Please enter which operator you want (1 = +, 2 = -, 3 = *, 4 = /): ";
 
    int op;
    std::cin >> op;
 
    // What if the user enters an invalid character?
    // We'll ignore this possibility for now
 
    return op;
}
 
int calculateResult(int x, int op, int y)
{
    // note: we use the == operator to compare two values to see if they are equal
    // we need to use if statements here because there's no direct way to convert op into the appropriate operator
 
    if (op == 1) // if user chose addition (#1)
        return x + y; // execute this line
    if (op == 2) // if user chose subtraction (#2)
        return x - y; // execute this line
    if (op == 3) // if user chose multiplication (#3)
        return x * y; // execute this line
    if (op == 4) // if user chose division (#4)
        return x / y; // execute this line
	
    return -1; // default "error" value in case user passed in an invalid op
    // note: This isn't a good way to handle errors, since -1 could be returned as a legitimate value
}
 
void printResult(int result)
{
    std::cout << "Your result is: " << result << std::endl;
}
 
int main()
{
    // Get first number from user
    int input1 = getUserInput();
 
    // Get mathematical operation from user
    int op = getMathematicalOperation();
 
    // Get second number from user
    int input2 = getUserInput();
 
    // Calculate result and store in temporary variable (for readability/debug-ability)
    int result = calculateResult(input1, op, input2 );
 
    // Print result
    printResult(result);
}
I did not understood the first question but I did understood the second one so I'm gonna answer it.

If you learned all this stuff in just 2 days then you are doing great and yes I think you learned faster than most of new comers would learn in just 2 days, it all gets down to your motivation, curiosity and imagination.

Keep going you just learned the very basics of c++ , you will see the languages true potential when you will learn about while and for loops, recursivity, classes, templates etc

I'll say a couple things to make my first question clearer. Are Console Applications a do-all project? If I want to make artificial intelligence should it be a Console Application? I'm using the CodeBlocks Compiler. It asks yiu to pick a project type to open and then do ya coding in~
If you want to use the Console, then you create a Console application, it's that simple. If you're making a game using SFML or SDL for example, most likely you don't need the console.

So it depends on what kind of AI program you're gonna work on.
While my AI is simple, and short code needed, it may need the most advanced techniques/symbols to implement it into the code, so should I code it in a Console Application or other project-type?
While my AI is simple, and short code needed, it may need the most advanced techniques/symbols to implement it into the code, so should I code it in a Console Application or other project-type?


There are no limitations to the "techniques/symbols" used to "implement it into the code" present in one project type that is not also present in another. This is a non-issue.
So then why must I choose a project type before creating the page to type my code into? What does each one do different? I must select the right one!
So then why must I choose a project type before creating the page to type my code into?

There is no "must." You're perfectly free to write code without creating a project. Likewise, your code isn't tied to the type of project that uses it. If you want to use a console (and I imagine you do) then use a console application. If you decide you want to change the type of the project later... change the project type later.

This isn't a difficult decision.
If you can learn That all in just two-days that meant you really intended to learn C++ i don't know how long i learned C++ before, anyway good work...
But do you know (simply put) what putting my c++ code into different project types does?
But do you know (simply put) what putting my c++ code into different project types does? 


I don't know, maybe you're over enthusiastic about coding and try it three times?
i saw your codes is about functions..
"I don't know, maybe you're over enthusiastic about coding and try it three times?"
What do you mean by your first line? It didn't make sense. Make sure to make all of it clearer.

"i saw your codes is about functions.."
.....so?... ???
While my AI is simple, and short code needed, it may need the most advanced techniques/symbols to implement it into the code, so should I code it in a Console Application or other project-type?


You can consider putting the AI code into a static library or into a DLL.

Other projects that might want to reuse the AI code would simply need to include header files only.

whichever method you choose, (lib or dll) just instruct your linker to link against prebuilt AI library. (import lib for dll or static lib for lib)
Ok, all I still want to know that's left now is what Gibsrey meant by those two lines I asked about just above ^, ? ? ? Lol?? ?
Topic archived. No new replies allowed.