2 * Test board mask calculation functions.
3 * Copyright © 2022-2023 Nick Bowler
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
23 enum { display_width = 12 };
25 static void show_patterns(const char *name, uint_fast32_t func(int))
27 unsigned long vals[5];
28 int i, row, labelw = display_width;
30 for (i = 0; i < 5; i++) {
31 printf("%*s", display_width-labelw, "");
32 labelw = printf("%2s(%d)", name, i);
37 for (row = 0; row < 5; row++) {
39 for (i = 0; i < 25; i++) {
46 printf("%*s", display_width-5, "");
47 putchar(val & 1 ? '@' : '.');
56 show_patterns("left", board_left);
58 show_patterns("right", board_right);
60 show_patterns("above", board_above);
62 show_patterns("below", board_below);