summaryrefslogtreecommitdiff
path: root/match.c
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-01 10:34:36 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-01 10:34:36 -0700
commit9459b7fb563caae520bdf8d11da9b070ebff45e9 (patch)
tree4f20b3ead4224d564fd3b0a4d67b0ede98b5912d /match.c
parentf9117e7c9b5b6602e4eb55ee48815882a7085782 (diff)
downloaddartboat-9459b7fb563caae520bdf8d11da9b070ebff45e9.tar.gz
dartboat-9459b7fb563caae520bdf8d11da9b070ebff45e9.tar.xz
move valid points check to match file
Diffstat (limited to 'match.c')
-rw-r--r--match.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/match.c b/match.c
index 6bd1426..d8f8a23 100644
--- a/match.c
+++ b/match.c
@@ -34,3 +34,26 @@ void leg_grow_visits(struct leg *l)
l->visits = realloc(l->visits, 2 * bytes);
memset((char *)l->visits + bytes, 0, bytes);
}
+
+bool is_points_valid(int pts, int rem)
+{
+ return pts <= rem &&
+ rem - pts != 1 &&
+ pts >= 0 &&
+ pts <= 180 &&
+ pts != 179 &&
+ pts != 178 &&
+ pts != 176 &&
+ pts != 175 &&
+ pts != 173 &&
+ pts != 172 &&
+ pts != 169 &&
+ pts != 166 &&
+ pts != 163 &&
+ (rem - pts != 0 ||
+ (pts <= 170 &&
+ pts != 168 &&
+ pts != 165 &&
+ pts != 162 &&
+ pts != 159));
+}