I'm trying to create a game (tic tac toe) and I have to use a library. I used ncurses to make the appearance appealing. However, each time I implement ncurses into my code it runs but DOES NOT run my main code that starts the game.. it either exits out or does not allow me to see the user input.. What can I do? This is the code:
#include <iostream>
#include <cstdlib>
#include <string>
#include <ctime>
#include "board.h"
#include "players.h"
#include <ncurses.h>
using namespace std;
/**
* Controls main function of the game
*/
int main(int argc, char** argv) {
initscr();
cbreak();
refresh();
WINDOW* windowTest = newwin(1, 23, 3, 0);
wprintw(windowTest, "Hello World");
//refresh();
wrefresh(windowTest);
getch();
delwin(windowTest);
endwin();
return 0;
string name;
cout << "What's your name: ";
cin >> name;
cout << "Nice to meet you, "<< name << ". Welcome to Tic Tac Toe!" << endl;
//Player is a object and does not matter here
Player game;
game.play();
return 0;
};