2024-06-04 17:01:41 +02:00

78 lines
4.1 KiB
C++

#include <cstddef>
#include <iostream>
#include <vector>
#include "global.hpp"
#include "net.hpp"
#include "input.hpp"
#include "gameplay.hpp"
using std::cout;
using std::cin;
using std::cerr;
int main() {
cout << R"( ___ __ _______ ___ ________ ________ _____ ______ _______ _________ ________
|\ \ |\ \|\ ___ \ |\ \ |\ ____\|\ __ \|\ _ \ _ \|\ ___ \ |\___ ___\\ __ \
\ \ \ \ \ \ \ __/|\ \ \ \ \ \___|\ \ \|\ \ \ \\\__\ \ \ \ __/| \|___ \ \_\ \ \|\ \
\ \ \ __\ \ \ \ \_|/_\ \ \ \ \ \ \ \ \\\ \ \ \\|__| \ \ \ \_|/__ \ \ \ \ \ \\\ \
\ \ \|\__\_\ \ \ \_|\ \ \ \____\ \ \____\ \ \\\ \ \ \ \ \ \ \ \_|\ \ \ \ \ \ \ \\\ \
\ \____________\ \_______\ \_______\ \_______\ \_______\ \__\ \ \__\ \_______\ \ \__\ \ \_______\
\|____________|\|_______|\|_______|\|_______|\|_______|\|__| \|__|\|_______| \|__| \|_______|
________ ___ ___ _______ ________ _________ ___ ___ _______ ________ _______ _________ ___ __ ________ ________ ___ __
|\ __ \|\ \ / /|\ ___ \ |\ __ \ |\___ ___\\ \|\ \|\ ___ \ |\ ___ \|\ ___ \|\___ ___\\ \ |\ \|\ __ \|\ __ \|\ \|\ \
\ \ \|\ \ \ \ / / | \ __/|\ \ \|\ \ \|___ \ \_\ \ \\\ \ \ __/| \ \ \\ \ \ \ __/\|___ \ \_\ \ \ \ \ \ \ \|\ \ \ \|\ \ \ \/ /|_
\ \ \\\ \ \ \/ / / \ \ \_|/_\ \ _ _\ \ \ \ \ \ __ \ \ \_|/__ \ \ \\ \ \ \ \_|/__ \ \ \ \ \ \ __\ \ \ \ \\\ \ \ _ _\ \ ___ \
\ \ \\\ \ \ / / \ \ \_|\ \ \ \\ \| \ \ \ \ \ \ \ \ \ \_|\ \ \ \ \\ \ \ \ \_|\ \ \ \ \ \ \ \|\__\_\ \ \ \\\ \ \ \\ \\ \ \\ \ \
\ \_______\ \__/ / \ \_______\ \__\\ _\ \ \__\ \ \__\ \__\ \_______\ \ \__\\ \__\ \_______\ \ \__\ \ \____________\ \_______\ \__\\ _\\ \__\\ \__\
\|_______|\|__|/ \|_______|\|__|\|__| \|__| \|__|\|__|\|_______| \|__| \|__|\|_______| \|__| \|____________|\|_______|\|__|\|__|\|__| \|__|
_________ ___ ________ _________ ________ ________ _________ ________ _______
|\___ ___\\ \|\ ____\ |\___ ___\\ __ \|\ ____\ |\___ ___\\ __ \|\ ___ \
\|___ \ \_\ \ \ \ \___| ___________\|___ \ \_\ \ \|\ \ \ \___| ___________\|___ \ \_\ \ \|\ \ \ __/|
\ \ \ \ \ \ \ \ |\____________\ \ \ \ \ \ __ \ \ \ |\____________\ \ \ \ \ \ \\\ \ \ \_|/__
\ \ \ \ \ \ \ \___\|____________| \ \ \ \ \ \ \ \ \ \___\|____________| \ \ \ \ \ \\\ \ \ \_|\ \
\ \__\ \ \__\ \_______\ \ \__\ \ \__\ \__\ \_______\ \ \__\ \ \_______\ \_______\
\|__| \|__|\|_______| \|__| \|__|\|__|\|_______| \|__| \|_______|\|_______|
)" << '\n';
ishost_check();
if (ishost) {
board_size_check();
length_check();
} else {
ip_check();
}
port_check();
{
int init_net_status = init_net();
if (init_net_status != 0) {
cerr << "failed to initialize network\n";
return 2;
}
}
//alocate board
std::vector<std::vector<char>> board(board_size, std::vector<char>(board_size, '_'));
printBoard(board);
return 0;
}