summaryrefslogtreecommitdiffstats
path: root/src/main.c
blob: 1034b2a4dfcc0e6ab36bea6594e9df655d94bc70 (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(1);

	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();
}