aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index f80e4f7..e29406e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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);