summaryrefslogtreecommitdiff
path: root/comp.c
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-04-28 13:13:14 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-04-28 13:13:14 -0700
commitfcc02efbff337c05bf448231cd8bfbe016939f8a (patch)
tree4114353a7337f830827a3bfcf1552a50367ed0c2 /comp.c
parent23fb49962b01b71f258bcd7933760aa609c453fb (diff)
downloaddartboat-fcc02efbff337c05bf448231cd8bfbe016939f8a.tar.gz
dartboat-fcc02efbff337c05bf448231cd8bfbe016939f8a.tar.xz
web: the bot should have his own dartboard
Diffstat (limited to 'comp.c')
-rw-r--r--comp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/comp.c b/comp.c
index c0a673a..9427363 100644
--- a/comp.c
+++ b/comp.c
@@ -84,6 +84,7 @@ void comp_visit(struct leg *l)
{
struct visit *v = l->visits + l->n_visits++;
v->darts = calloc(3, sizeof(*(v->darts)));
+ v->ccoords = calloc(3, sizeof(*(v->ccoords)));
for (int i = 0; i < 3; ++i) {
struct segment ts = next_dart(l->rem - v->points, 3 - i);
@@ -91,6 +92,7 @@ void comp_visit(struct leg *l)
struct pcoords dc = throw_dart(tc);
struct segment ds = get_segment(dc);
+ v->ccoords[v->n_darts] = pol_to_cart(dc); // FIXME double conversion
v->darts[v->n_darts++] = ds;
v->points += segment_points(ds);