day2: part1

Fortune for day2's current commit: Middle blessing − 中吉
master
Avril 3 years ago
parent 50e1f31093
commit 388a3282a1
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -20,10 +20,12 @@ struct proc {
#define _LIT_MV_UP "up"
#define _LIT_MV_DOWN "down"
_Static_assert(sizeof(_LIT_MV_FORWARD)==8, "bad literal size");
static const struct proc MAP[255] = {
['f'] = { .mv = 8, .field = (offsetof(struct psum, forward) / sizeof(result_t)) },
['u'] = { .mv = 3, .field = (offsetof(struct psum, up) / sizeof(result_t)) },
['d'] = { .mv = 5, .field = (offsetof(struct psum, down) / sizeof(result_t)) },
['f'] = { .mv = sizeof(_LIT_MV_FORWARD), .field = (offsetof(struct psum, forward) / sizeof(result_t)) },
['u'] = { .mv = sizeof(_LIT_MV_UP), .field = (offsetof(struct psum, up) / sizeof(result_t)) },
['d'] = { .mv = sizeof(_LIT_MV_DOWN), .field = (offsetof(struct psum, down) / sizeof(result_t)) },
};
static const unsigned char DIGITS[255] = {

Loading…
Cancel
Save