From: Alexander Fedotov Date: Mon, 11 Apr 2016 12:06:35 +0000 (+0100) Subject: check space helper added X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=03c6e2f515f6516448ec39aa40a439b9fc20c4c8;p=mc1516pa.git check space helper added --- diff --git a/modelchecker/coord.c b/modelchecker/coord.c index be9d36d..f5774a6 100644 --- a/modelchecker/coord.c +++ b/modelchecker/coord.c @@ -164,6 +164,17 @@ int check_xy_exists(int x, int y, bimap *bm) return res; } +int check_space(int x, int y, direction d, int delta, bimap *bm) +{ + switch(d){ + case LEFT: x = x - delta; break; + case UP: y = y - delta; break; + case RIGHT: x = x + delta; break; + case DOWN: y = y + delta; break; + } + return check_xy_exists(x, y, bm); +} + /* * Each coordinate has three related boolean variables. The combination of those boolean variables * defines tiles: