diff options
Diffstat (limited to 'field.c')
-rw-r--r-- | field.c | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -17,7 +17,7 @@ static const char field_sample[field_height][field_width] = { {"/1....2//1..1//1..1//2....1/"}, {"//////.///// // /////.//////"}, {" /.///// // /////./ "}, - {" /.//1 y y 1//./ "}, + {" /.//1 y11y 1//./ "}, {" /.// ///##/// //./ "}, {"//////.// / /2 2//////"}, {" 3 2/ / //2 "}, @@ -55,9 +55,10 @@ game_space get_new_field() int field_has_coin(int x, int y) { - return !((x == 12 && y == 9) || (x == 12 && y == 18) || - (x == 14 && y == 18) || (x == 15 && y == 9) || - (x == 17 && y == 9) || (x == 17 && y == 18)); + return !((x == 9 && y == 12)|| (x == 18 && y == 12) || + (x == 18 && y == 14) || (x == 9 && y == 15) || + (x == 9 && y == 17) || (x == 18 && y == 17) || + (x == 13 && y == 12) || (x == 14 && y == 12)); } int field_has_energizer(const game_space field, int x, int y) @@ -242,3 +243,14 @@ void clear_energizer(game_space field, struct coordinates point) y = point.y; field[y][x] = ' '; } + +int is_equal_points(struct coordinates first_point, struct coordinates + second_point) +{ + int x1, y1, x2, y2; + x1 = first_point.x; + y1 = first_point.y; + x2 = second_point.x; + y2 = second_point.y; + return x1 == x2 && y1 == y2; +} |