A little C++ program to have timed rounds for a game I know it could be better, but I’m new to C++, so I don’t know many of the tricks, along with some of the includes that are already obsolete.

This program asks for names as input, adds a time for rounds, and then times each player’s turn (i.e. for use in charades). Proven to compile with MinGW cpp.

Precompiled version: https://github.com/ProjectArrow78/EasyGame

#include &lt;iostream&gt;
#include &lt;cmath&gt;
#include &lt;chrono&gt;
#include &lt;ctime&gt;
#include &lt;stdlib.h&gt;
#include &lt;windows.h&gt;
#include &lt;cwchar&gt;
#include &lt;vector&gt;

using namespace std;

vector&lt;string&gt; playerlist;
string currentplayer;
string previousplayer;
bool setprevious = true;
int playercount;
int playerprogression = 1;
int roundtime;
int timescale = 1000;
// Regular timescale: 1000

void collectnames() {
    string playercollected;
    bool continuenameloop;
    bool firstloop = true;
    int playerscollected = 1;

        cout &lt;&lt; "How many players will there be?" &lt;&lt; endl;
    cin &gt;&gt; playercount;
    playerlist.resize (playercount);
    while(continuenameloop) {
        cout &lt;&lt; "Who is player " &lt;&lt; playerscollected &lt;&lt; "?" &lt;&lt; endl;
        if(firstloop == true) {
            cin.ignore();
            firstloop = false;
        }
        getline(cin, playercollected);
        playerlist.insert (playerlist.begin() + playerscollected, playercollected);
        playerscollected++;

        if(playerscollected == playercount+1) {
            continuenameloop = false;
        }
    }
}

void introduction() {
    cout &lt;&lt; "Welcome to EasyGame" &lt;&lt; endl;
    collectnames();
    cout &lt;&lt; "How many minutes per turn?" &lt;&lt; endl;
    cin &gt;&gt; roundtime;
}

void playerlogic() {
    playerprogression++;
    previousplayer = currentplayer;
    if(playerprogression &gt; playercount) {
        playerprogression = 1;
    }
    currentplayer = playerlist [playerprogression];
    if(setprevious == true) {
        previousplayer = playerlist [1];
        setprevious = false;
    }
}

void skipturn() {
    char playturn;

    cout &lt;&lt; "It is " &lt;&lt; playerlist [playerprogression] &lt;&lt; "'s turn!" &lt;&lt; endl;
    cout &lt;&lt; "Play turn? (Y/N)" &lt;&lt; endl;
    cin &gt;&gt; playturn;
    if(playturn == 'n' or playturn == 'N') {
        playerlogic();
        skipturn();

    }
}

void playertime() {
    bool runtimer = true;
    int timeremaining = roundtime;

    while(runtimer) {
        cout &lt;&lt; string( 100, '\n' );
        cout &lt;&lt; "You have " &lt;&lt; timeremaining &lt;&lt; " minutes remaining." &lt;&lt; endl;
        Sleep(roundtime * timescale * 12);
        timeremaining--;
        if(timeremaining == 0) {
            cout &lt;&lt; string( 100, '\n' );
            cout &lt;&lt; previousplayer &lt;&lt; "'s time is up! \n" &lt;&lt; endl;
            runtimer = false;
        }
    }
}

int main() {
    system("color 71");
    SetConsoleTitle("EasyGame");
    introduction();
    while(true) {
        playerlogic();
        playertime();
        skipturn();
    }
}
First, it's really not too bad for a beginner, there are functions with local variables and the function names are descriptive. I'm impressed with the fact that all if statements and loops use the braces ({ and }) to create compound statements even though it isn't strictly necessary, it does make maintenance much easier.

Initialize Local Variables
In the function collectnames() the variable continuenameloop is uninitialized. In some program languages this isn't a problem local variables are initialized with a null value which might make continuenameloop false (not what is desired in this case). In C++ all local variable are unitialized which means they are in an unknown state. This may have been a typo since the other local variables are initialized.

Prefer std::NAME over using namespace std;
If you are coding professionally you probably should get out of the habit of using the "using namespace std;" statement. The code will more clearly define where cout and other functions are coming from (std::cin, std::cout). As you start using namespaces in your code it is better to identify where each function comes from because there may be function name collisions from different namespaces. The function cout you may override within your own classes. This stack overflow question discusses this in more detail.

Global Variables
Generally global variables are considered a bad practice (2 references from stackexchange sites, stackoverflow and software engineering). In larger programs with multiple source files it is very difficult to write correct code, debug and maintain code using global variables. Finding where a variable value is altered becomes a huge task. A second problem with global variables in a multi-file program is that global variables are global in scope and can lead to duplicate definitions at link time. In an object oriented program all of these variables could have been global within the object but the scope would still be limited to the object itself.

In non-object oriented programming it might be better to declare the variables in functions or procedures and pass the values into sub functions.

Error Checking
There doesn't seem to be any error checking, users have been known to enter the wrong information. What happens if a negative value for roundtime is entered?

Use Objects
As the game gets more complex it might be a good idea to create classes to implement it. Most of the this current program might fit into a class called game. It might be beneficial if users were a separate class with scores, and possibly  elapsed times. Using objects will allow the code to be independent from other portions of the code, and details of the implementation can be hidden.