algorithm – Improving C++ Connect-four game with little AI

Here is the code for the game :

#include <iostream>
#include <sstream>
#include <string>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <vector>

using std::vector;
using std::cout;
using std::cin;
using std::endl;
using std::time;
using std::stringstream;
using std::string;
using std::to_string;
const string bot = "B";

void riftmaker(int coordx, int coordy , vector<vector<string>>& rboard);
void infinity_ikea(const vector<vector<string>>& rboard);
void introduction(const vector<vector<string>>& rboard);
bool legal(const vector<vector<string>>& rboard , int choice , string skin);
bool wincon(const vector<vector<string>>& rboard , int coordx , int coordy);
void COMMANDO(vector<vector<string>>& rboard, int choice, string skin, string command , string player);
void pepegaheadqurters(int coordx ,int  coordy , vector<vector<string>>& rboard);
void error();
int skynet(vector<vector<string>>& rboard, string skin , int limit , int coordx , int coordy);

int main()
{
    //elements
    int coordx, coordy;
    srand(static_cast<unsigned int>(time(0)));
    //COORDS
    cout << "enter horizntal size :";
    cin >> coordx;
    cout << "enter vertical size :";
    cin >> coordy;
    vector<vector<string>> board;
    riftmaker(coordx, coordy, board);

    //INTRODUCTIONS
    introduction(board);
    std::cin.ignore(std::numeric_limits<std::streamsize>::max(), 'n');
    cin.get();
    //main
    pepegaheadqurters(coordx, coordy, board);
}

void riftmaker(int coordx , int coordy , vector<vector<string>>& rboard)//VECTOR ASSIGNER
{
    int boardnumber = 1;
    for (int i = 0; i < coordx; i++)
    {
        vector<string> row;
        for (int j = 0; j < coordy; j++)
        {
            row.push_back(to_string(boardnumber));
            boardnumber++;
        }
        rboard.push_back(row);
    }

}

void infinity_ikea(const vector<vector<string>>& rboard) //PRINTER
{
    int numberl;
    for (vector<string> loop : rboard) {
        for (string x : loop) {
            stringstream geek(x);
            geek >> numberl;
            cout << x;
            if (numberl < 10) {
                cout << " | ";
            }
            else if (numberl < 100 || numberl > 9) {
                cout << "| ";
            }
            else if (numberl == 0) {
                cout << " | ";
            }
            else {
                cout << " | ";
            }
        }
        cout << "n";
    }
}
void introduction(const vector<vector<string>>& rboard) // INTRO
{
    cout << "tt4-CONNECTnt-----------------------nnn";
    cout << "WELCOME TO 4-CONNECT U KNOW THE RULES AND THE SHT" << endl;
    cout << "the board :" << endl;
    infinity_ikea(rboard);
}

void pepegaheadqurters(int coordx, int  coordy, vector<vector<string>>& rboard) //MAIN FUNCTION
{
    //elements
    int limit = coordx * coordy;
    int blank = 0;
    int boardnumber, loobyposition;
    string skin, roboskin;
    roboskin = 'B';
    int robot;
    int i = 0;
    enum wincondition
    {
        win, lose, tie
    };
    wincondition w = win;


    //main body
    cout << "which letter will u use :";
    cin >> skin;
    cout << "ndo u want to start first(0) or machine(1) :";
    cin >> loobyposition;
    error();


    //game loop
    while (blank != limit && wincon(rboard, coordx, coordy) != true)
    {
        if (loobyposition % 2 == 0) {
            infinity_ikea(rboard);
            cout << "enter number pls :";
            cin >> boardnumber;
            boardnumber -= 1;
            COMMANDO(rboard, boardnumber, skin, "MOVE", "human");
            wincon(rboard, coordx, coordy);
            error();
            infinity_ikea(rboard);
            std::cin.ignore(std::numeric_limits<std::streamsize>::max(), 'n');
            cin.get();
            error();
            blank++;
            loobyposition++;
            if (wincon(rboard , coordx , coordy)) {
                w = win;
            }
        }
        else if (loobyposition % 2 != 0 || wincon(rboard, coordx, coordy) != true) {
            robot = skynet(rboard, skin, limit, coordx, coordy);
            infinity_ikea(rboard);
            cout << "my number is :" << robot << endl;
            std::cin.ignore(std::numeric_limits<std::streamsize>::max(), 'n');
            cin.get();
            error();
            loobyposition++;
            blank++;
            if (wincon(rboard , coordx , coordy)) {
                w = lose;
            }

        }
    }
    infinity_ikea(rboard); 

    cout << "n" << endl;
    if (blank == limit && wincon(rboard, coordx, coordy) != true) {
        w = tie;
    }
    if (w == win) {
        cout << "congrats u won";
    }
    else if (w == lose) {
        cout << "congreat u lose";
    }
    else {
        cout << "TIE";
    }
}




void error() // NEW PAGE
{
    for (int  i = 0; i < 1000; i++)
    {
        cout << "nn";
    }
}
bool wincon(const vector<vector<string>>& rboard, int coordx, int coordy) //WIN CONDITIONS
{
    bool check = true;
    int equ1, equ2;
    for (int x = 0; x < coordx; x++)
    {
        for (int y = 0; y < coordy; y++)
        {
            string startvalue = rboard(x)(y);
            int possiblex(4)(2) = { {0 , 1} , {1 , 0} , {1 , -1} , {1 , 1} };

            //checkloop
            for (int j = 0; j < 4; j++)
            {
                check = true;
                int i = 0;
                for (int b = 1; b < 4; ++b) {
                    equ1 = (x + (b * possiblex(j)(i)));
                    equ2 = (y + (b * possiblex(j)(i + 1)));
                    if (equ1 < 0 || equ1 == coordx) {
                        check = false;
                        break;
                    }
                    else if (equ2 < 0 || equ2 == coordy) {
                        check = false;
                        break;
                    }
                    else
                    {
                        if (rboard(equ1)(equ2) != startvalue) {
                            check = false;
                        }
                    }
                }
                if (check == true) {
                    return check;
                }

            }
        }
    }
    return check;
}



void COMMANDO(vector<vector<string>>& rboard , int choice , string skin , string command , string player) //MOVE AND DELETE
{
    int counter = 0;
    int cols = 0;
    vector<vector<string>>::iterator raw;
    vector<string>::iterator col;

    for (raw = rboard.begin(); raw != rboard.end(); raw++) {
        for (col = raw->begin(); col != raw->end(); col++){
            if (counter == choice) {
                if (command == "MOVE") {
                    counter += raw->size();
                    while (raw != (rboard.end() - 1) && legal(rboard, counter, skin) == true)
                    {
                        raw++;
                        col = raw->begin() + cols;
                        counter += raw->size();
                    }
                    if (player == "human") {
                        *col = skin;
                    }
                    else
                    {
                        *col = bot;
                    }
                }
                else if (command == "DELETE") {
                    while (raw != (rboard.end() - 1) && legal(rboard, counter, skin) == true)
                    {
                        raw++;
                        col = raw->begin() + cols;
                        counter += raw->size();
                    }
                    if (*col == skin || *col == bot) {
                        *col = to_string(counter+1);
                    }
                }
            }
            counter++;
            cols++;
        }
        cols = 0;
    }
}



bool legal(const vector<vector<string>>& rboard , int choice ,string skin ) //LEGAL OR NOT
{
    int counter = 0;
    for (vector<string> loop : rboard) {
        for (string x : loop) {
            if (choice == counter){
                if (x == skin || x == bot) {
                    return false;
                }
            }
            counter++;
        }
    }
    return true;
}
int skynet(vector<vector<string>>& rboard, string skin, int limit, int coordx, int coordy) //AI
{
    //checkwin and stop win
    int counter = 0;
    while (counter < limit) {
        if (legal(rboard, counter, skin)) {
            //check win
            COMMANDO(rboard, counter, skin, "MOVE", "bot");
            if (wincon(rboard, coordx, coordy) == true) {
                return counter + 1;
            }
            COMMANDO(rboard, counter, skin, "DELETE", "bot");
            //check enemy
            COMMANDO(rboard, counter, skin, "MOVE", "human");
            if (wincon(rboard, coordx, coordy) == true) {
                COMMANDO(rboard, counter, skin, "DELETE", "human");
                COMMANDO(rboard, counter, skin, "MOVE", "bot");
                return counter + 1;
            }
            COMMANDO(rboard, counter, skin, "DELETE", "human");

        }
        counter++;
    }
    //random number generatror
    for (int i = 0; i < 1000; i++)
    {
        counter = rand() % limit;
        if (legal(rboard, counter, skin)) {
            COMMANDO(rboard, counter, skin, "MOVE", "bot");
            return counter + 1;
        }
    }
}

What could I have done better with this code, how could I make it shorter.

I know some functions have childish names, but I wrote their function near their definitions.

I overcomplicated stuff with the move and delete function and wincondition function, could I make it easier or not, or it’s good.