~ecs/tbrace

tbrace/main.c -rw-r--r-- 462 bytes
f007a19d — Eyal Sawady Makefile: rewrite 10 months ago
                                                                                
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
#include <stdio.h>

#include "state.h"
#include "update.h"

int
main(int argc, char **argv)
{
	const char *filename = "./tracks/test";
	FILE *track;
	struct state *state;
	if (argc > 2) {
		printf("Usage: %s [file]\n", argv[0]);
		return 1;
	}
	if (argc == 2) {
		filename = argv[1];
	}
	printf("Welcome to %s!\n\n", argv[0]);

	track = fopen(filename, "r");
	state = load_state(track);
	fclose(track);
	while (tick(*state));
	destroy_state(state);
	return 0;
}