aboutsummaryrefslogtreecommitdiff
path: root/test/032_invertmoves/invertmoves_tests.c
blob: d5da3238799ed1f9f9e2c867710513e3db5c632d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "../test.h"

#define MAXMOVES 20

int64_t readmoves(const char *, int, uint8_t *);
void writemoves(uint8_t *, int, uint64_t, char *);
void invertmoves(uint8_t *, uint8_t, uint8_t *);

void run(void) {
	char movestr[STRLENMAX], outstr[STRLENMAX];
	uint8_t moves[MAXMOVES], ret[MAXMOVES];
	int c;

	fgets(movestr, STRLENMAX, stdin);
	c = readmoves(movestr, MAXMOVES, moves);

	invertmoves(moves, c, ret);
	writemoves(ret, c, STRLENMAX, outstr);

	printf("%s\n", outstr);
}

Generated with cgit - Back to sebastiano.tronto.net