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