if (collision_loc == surface.landing_right) { if (do_olog_write) { /* just some logging stuff */ char col = do_other_col ? 's' : 'b'; fprintf(olog, "l %d,%d %d,%d %c;", (int)ship.x, (int)ship.y, (int)stale.x, (int)stale.y, col); } if (successful_landing(ago)) { /* hit landing pad, not too fast */ float score = 10 * ago.fuel + (20 - std::abs(ago.v_x)) + (30 - std::abs(ago.v_y)); return score; } else { /* hit landing pad but too fast */ float score = (20 - std::abs(ago.v_x)) + (30 - std::abs(ago.v_y)); return score; } } else { /* missed landing pad */ float score = 20 / (distance_from_landing(stale) + 1); return score; } }