diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-04-28 13:13:14 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-04-28 13:13:14 -0700 |
commit | fcc02efbff337c05bf448231cd8bfbe016939f8a (patch) | |
tree | 4114353a7337f830827a3bfcf1552a50367ed0c2 /comp.c | |
parent | 23fb49962b01b71f258bcd7933760aa609c453fb (diff) | |
download | dartboat-fcc02efbff337c05bf448231cd8bfbe016939f8a.tar.gz dartboat-fcc02efbff337c05bf448231cd8bfbe016939f8a.tar.xz |
web: the bot should have his own dartboard
Diffstat (limited to 'comp.c')
-rw-r--r-- | comp.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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); |