#pragma once #include #include typedef uint64_t u64; typedef uint8_t u8; // as bit array: [16 * y + 4 * x + z] // (x,y) = floor position, z = height with z=0 on the bottom typedef u64 board_t[2]; typedef const u64 cboard_t[2]; enum win_t { WIN_NONE, WIN_P0, WIN_P1, WIN_DRAW, }; void b_set(board_t B, cboard_t C); void b_drop(board_t B, int xy, int v); bool b_stk_full(cboard_t B, int xy); enum win_t b_win(cboard_t B);