From 03c6e2f515f6516448ec39aa40a439b9fc20c4c8 Mon Sep 17 00:00:00 2001 From: Alexander Fedotov Date: Mon, 11 Apr 2016 13:06:35 +0100 Subject: [PATCH] check space helper added --- modelchecker/coord.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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: -- 2.20.1