собери все в один файл 

#ifndef MATRIX_APPMANAGER_H
#define MATRIX_APPMANAGER_H


class AppManager {
public:
    AppManager();
    void start(int argc, char* argv[]);

private:
    int speed;
    int length;
    bool epilepsyMode;
    bool running;
    int consoleWidth;
    int consoleHeight;

    void configureSettings();
    bool parseCommandLineArgs(char* argv[]);
    void hideConsoleCursor();
    void getConsoleSize();
};


#endif //MATRIX_APPMANAGER_H

#include "Line.h"
#include <iostream>
#include <algorithm>

Line::Line(int length, bool epilepsyMode) : length(length), epilepsyMode(epilepsyMode) {
    if (epilepsyMode) {
        lineColor = getRandomColor();
    } else {
        lineColor = 10; // зеленый по умолчанию
    }

    //заполнение вектора случайными символами и цветами
    for (int i = 0; i < length; ++i) {
        char randomChar = getRandomCharacter();
        int color = epilepsyMode ? lineColor : 10;
        symbols.push_back(Symbol(randomChar, color)); //implace_back метод
    }
}

void Line::move() {
    symbols[0] = Symbol(' ', 7); //удаление первого символа(замена на пробел)
    for (int i = 1; i < length - 1; ++i) {
        symbols[i] = symbols[i + 1]; //сдвиг символов вправо
    }
    generateNewSymbol(length - 1); //генерация нового случайного символа справа
}


//метод отрисовки линии в окне консоли
void Line::draw(HANDLE hConsole, int position, int consoleWidth, int startPosition) const {
    COORD cursorPos;

    //удаление предыдущего символа на позиции (если символ в пределах консоли)
    if (position - 1 >= 0 && position - 1 < consoleWidth) {
        cursorPos.X = static_cast<SHORT>(position - 1);
        cursorPos.Y = startPosition;
        SetConsoleCursorPosition(hConsole, cursorPos);
        std::cout << " ";
    }

    //определение начального индекса и видимой длины строки
    int startIndex = std::max(0, -position);
    int visibleLength = std::min(length - startIndex, consoleWidth - position);

    //отрисовка символов в консоли
    for (int i = startIndex; i < startIndex + visibleLength; ++i) {
        setColor(getColor(i));
        cursorPos.X = static_cast<SHORT>(position + i);
        cursorPos.Y = startPosition;
        SetConsoleCursorPosition(hConsole, cursorPos);
        std::cout << getCharacter(i);
    }
}

void Line::generateNewSymbol(int index) {
    char newChar = getRandomCharacter();
    int color = epilepsyMode ? lineColor : 10;
    symbols[index] = Symbol(newChar, color);
}

char Line::getRandomCharacter() {
    const char characters[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+[]{}|;':\",.<>?~";
    return characters[rand() % (sizeof(characters) - 1)];
}

int Line::getRandomColor() {
    return 1 + rand() % 15;
}

void Line::setColor(int color) {
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color);
}


//получение символа по индексу
char Line::getCharacter(int index) const {
    if (index >= 0 && index < symbols.size()) {
        return symbols[index].getCharacter();
    }
    return ' ';
}


//получение цвета символа по индексу
int Line::getColor(int index) const {
    if (index >= 0 && index < symbols.size()) {
        return symbols[index].getColor();
    }
    return 7;
}

#ifndef MATRIX_LINE_H
#define MATRIX_LINE_H


#include <vector>
#include <windows.h>
#include "Symbol.h"

class Line {
public:
    Line(int length, bool epilepsyMode);

    void move();
    void draw(HANDLE hConsole, int position, int consoleWidth, int startPosition) const;

private:
    int length;
    std::vector<Symbol> symbols;
    bool epilepsyMode;
    int lineColor;

    void generateNewSymbol(int index);
    static char getRandomCharacter();
    static int getRandomColor();
    static void setColor(int color);
    char getCharacter(int index) const;
    int getColor(int index) const;
};


#endif //MATRIX_LINE_H
#include "Symbol.h"

Symbol::Symbol(char character, int color) : character(character), color(color) {}

char Symbol::getCharacter() const {
    return character;
}

void Symbol::setCharacter(char character) {
    this->character = character;
}

int Symbol::getColor() const {
    return color;
}

void Symbol::setColor(int color) {
    this->color = color;
}

#ifndef MATRIX_SYMBOL_H
#define MATRIX_SYMBOL_H


class Symbol {
public:
    Symbol(char character = ' ', int color = 10);

    char getCharacter() const;
    void setCharacter(char character);

    int getColor() const;
    void setColor(int color);

private:
    char character;
    int color;
};


#endif //MATRIX_SYMBOL_H

#include "AppManager.h"
#include "Line.h"
#include <iostream>
#include <cstdlib>
#include <conio.h>
#include <thread>
#include <chrono>
#include <windows.h>
#include <limits>

AppManager::AppManager() : speed(1), length(10), epilepsyMode(false), running(true) {
    srand(static_cast<unsigned int>(time(nullptr)));
    getConsoleSize();
}

void AppManager::start(int argc, char* argv[]) {



    if (argc == 4) {
        if (!parseCommandLineArgs(argv)) {
            return;
        }
    } else {
        configureSettings();
    }

    hideConsoleCursor();

    system("cls");
    std::cout << "Matrix Simulation is starting..." << std::endl;
    std::this_thread::sleep_for(std::chrono::seconds(1));

    HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);

    while (running) {
        int startPosition = rand() % (consoleHeight - 1); //рандомная позиция по высоте
        Line line(length, epilepsyMode);
        int position = -length;

        while (position < consoleWidth) {
            line.draw(hConsole, position, consoleWidth, startPosition);
            std::this_thread::sleep_for(std::chrono::milliseconds(1000 / speed));
            line.move();
            ++position;

            if (_kbhit() && _getch() == 'q') {
                running = false;
                break;
            }
        }

        if (epilepsyMode) {
            std::this_thread::sleep_for(std::chrono::milliseconds(500));
        }
    }
}

void AppManager::configureSettings() {
    std::cout << "Welcome to the Matrix Simulation!" << std::endl;
    std::cout << "Press 'q' anytime to quit the simulation." << std::endl;

    std::cout << "Enter speed (1 - 30): ";
    while (!(std::cin >> speed) || speed < 1 || speed > 30) {
        std::cin.clear();
        std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
        std::cout << "Invalid input. Please enter a number between 1 and 30: ";
    }

    std::cout << "Enter line length (1 - 30): ";
    while (!(std::cin >> length) || length < 1 || length > 30) {
        std::cin.clear();
        std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
        std::cout << "Invalid input. Please enter a number between 1 and 30: ";
    }

    char input;
    std::cout << "Epilepsy mode (Y/N)? ";
    while (!(std::cin >> input) || (input != 'Y' && input != 'y' && input != 'N' && input != 'n')) {
        std::cin.clear();
        std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
        std::cout << "Invalid input. Please enter 'Y' or 'N': ";
    }
    epilepsyMode = (input == 'Y' || input == 'y');
}

bool AppManager::parseCommandLineArgs(char* argv[]) {
    try {
        speed = std::stoi(argv[1]);
        length = std::stoi(argv[2]);
        char epilepsyChar = argv[3][0];

        if (speed < 1 || speed > 30 || length < 1 || length > 30 ||
            (epilepsyChar != 'Y' && epilepsyChar != 'y' && epilepsyChar != 'N' && epilepsyChar != 'n')) {
            std::cerr << "Invalid command line arguments." << std::endl;
            std::cerr << "Please, enter speed and length values (1-30). Epilepsy mode Y/N" << std::endl;
            std::cerr << "Example: 23 8 Y" << std::endl;
            return false;
        }

        epilepsyMode = (epilepsyChar == 'Y' || epilepsyChar == 'y');
        return true;
    } catch (...) {
        std::cerr << "Invalid command line arguments." << std::endl;
        std::cerr << "Please, enter speed and length values (1-30). Epilepsy mode Y/N" << std::endl;
        std::cerr << "Example: 23 8 Y" << std::endl;
        return false;
    }
}

void AppManager::hideConsoleCursor() {
    HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
    CONSOLE_CURSOR_INFO cursorInfo;
    GetConsoleCursorInfo(hConsole, &cursorInfo);
    cursorInfo.bVisible = FALSE;
    SetConsoleCursorInfo(hConsole, &cursorInfo);
}

void AppManager::getConsoleSize() {
    CONSOLE_SCREEN_BUFFER_INFO csbi;
    GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
    consoleWidth = csbi.srWindow.Right - csbi.srWindow.Left + 1;
    consoleHeight = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
}

#include "AppManager.h"

int main(int argc, char* argv[]) {
    AppManager appManager;
    appManager.start(argc, argv);

    return 0;
}