From a28369258b89e013103edcca20355eb61fffdf69 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Wed, 4 May 2022 11:08:23 -0700 Subject: formatting --- dartboat.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'dartboat.c') diff --git a/dartboat.c b/dartboat.c index aa59630..c265031 100644 --- a/dartboat.c +++ b/dartboat.c @@ -43,16 +43,19 @@ void user_visit(struct leg *l) if (l->rem <= 170) { char *target = CHECKOUTS[2][l->rem-1]; if (target) { - int trem = l->rem - segment_points(segment_from_name(target)); + int trem = l->rem - segment_points( + segment_from_name(target)); len += sprintf(status + len, " (%s", target); if (trem) { target = CHECKOUTS[1][trem-1]; len += sprintf(status + len, "-%s", target); - trem = trem - segment_points(segment_from_name(target)); + trem = trem - segment_points( + segment_from_name(target)); if (trem) { target = CHECKOUTS[0][trem-1]; - len += sprintf(status + len, "-%s", target); + len += sprintf(status + len, + "-%s", target); } } len += sprintf(status + len, ")"); @@ -118,18 +121,20 @@ void curses_match(int start_points, char *n1, void (*f1)(struct leg *), void cvc_curses_match(int start_points) { - curses_match(start_points, "Dartboat 1", comp_visit, "Dartboat 2", - comp_visit); + curses_match(start_points, "Dartboat 1", comp_visit, + "Dartboat 2", comp_visit); } void pvc_curses_match(int start_points) { - curses_match(start_points, "David", user_visit, "Dartboat", comp_visit); + curses_match(start_points, "David", user_visit, + "Dartboat", comp_visit); } void pvp_curses_match(int start_points) { - curses_match(start_points, "David", user_visit, "Davidn't", user_visit); + curses_match(start_points, "David", user_visit, + "Davidn't", user_visit); } void test_averages() @@ -146,7 +151,8 @@ void test_averages() comp_visit(l); leg_free(l); - darts += (l->n_visits-1)*3 + l->visits[l->n_visits-1].n_darts; + darts += (l->n_visits - 1) * 3 + + l->visits[l->n_visits-1].n_darts; } printf("%d %f\n", stdev, (double)(501*rounds)/darts*3); -- cgit v1.2.3-70-g09d2