summaryrefslogtreecommitdiffstats
path: root/src/main.c
blob: 408f47bd8af45072931bb9d2dbf0b2bc33614c82 (plain)
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
29
30
31
32
33
34
35
36
37
38
39
#include <curses.h>

#include "game.h"

static void init_curses(void);
static void fini_curses(void);

int
main(void)
{
	struct game *g;

	init_curses();
	g = new_game();

	run_game(g);

	free_game(g);
	fini_curses();

	return 0;
}

static void
init_curses(void)
{
	initscr();
	noecho();
	raw();
	keypad(stdscr, TRUE);
	curs_set(0);
}

static void
fini_curses(void)
{
	delwin(stdscr);
	endwin();
}