-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
28 lines (21 loc) · 709 Bytes
/
main.cpp
File metadata and controls
28 lines (21 loc) · 709 Bytes
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
#include "src/core/game.h"
int main(int argc, char** argv)
{
if (argc < 2) {
std::cerr << '\n' << "Voce deve iniciar o programa com o comando: .\\HangmanGame.exe";
std::cerr << "\033[32m" << " palavra" << "\033[0m" << "\n\n";
system("pause");
return -1;
}
const char* word = argv[1];
if (const size_t len = strlen(word) / sizeof(char); len < 4 || len > 16) {
std::cerr << '\n' << "A palavra misteriosa deve conter de 4 a 16 caracteres...";
std::cerr << '\n' << "A que voce inseriu contem " << len << "!\n\n";
system("pause");
return -1;
}
Game game = Game(word);
game.update();
game.run();
return 0;
}