diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -69,6 +69,12 @@ void create_structure_mask(char* board, char* structures) { } } +int translate_coordinate(int center_position) { + return (2 * (center_position / BOARD_WIDTH) + 1) * + (2 * BOARD_WIDTH + 1) + + (2 * (center_position % BOARD_WIDTH) + 1); +} + int main() { char board[BOARD_BYTES]; char structures[BOARD_BYTES]; @@ -76,10 +82,10 @@ int main() { initialize_board(board); initialize_board(structures); - place_tile("RFRFR", 6, board); - place_tile("RCCRR", 8, board); - place_tile("RRFRF", 18, board); - place_tile("CFFCC", 16, board); + place_tile("RFRFR", translate_coordinate(0), board); + place_tile("RCCRR", translate_coordinate(1), board); + place_tile("CFFCC", translate_coordinate(2), board); + place_tile("RRFRF", translate_coordinate(3), board); create_structure_mask(board, structures); print_board(board); |