|
@@ -19,10 +19,10 @@ avg_continental_rad_km = 1468.0
|
|
|
# somewhat arbitrarily, if you're within 1000 km, you get at least 3000 points
|
|
|
one_thousand = 1000.0
|
|
|
|
|
|
-# https://www.wolframalpha.com/input/?i=sqrt%28%28%28land+mass+of+earth%29+%2F+%28number+of+countries+on+earth%29%29+%2F+pi%29+in+kilometers
|
|
|
+# https://www.wolframalpha.com/input?i=sqrt%28%28land+mass+of+earth%29+%2F+%28number+of+countries+on+earth%29%29+%2F+pi+in+kilometers
|
|
|
# this is the average "radius" of a country
|
|
|
# within this radius, you get at least 4000 points
|
|
|
-avg_country_rad_km = 479.7
|
|
|
+avg_country_rad_km = 270.7
|
|
|
|
|
|
# if you're within 150m, you get a perfect score of 5000
|
|
|
min_dist_km = 0.15
|
|
@@ -77,4 +77,17 @@ def score_country_race(target: str, guess: str, time_remaining: int, time_total:
|
|
|
return 5000
|
|
|
|
|
|
# TODO make this into an interesting curve but for now linear is fine
|
|
|
- return int(5000 * (time_remaining / time_total))
|
|
|
+ return int(5000 * (time_remaining / time_total))
|
|
|
+
|
|
|
+
|
|
|
+def score_hard(target: Tuple[float, float], guess: Tuple[float, float]) -> Tuple[int, float]:
|
|
|
+ """
|
|
|
+ Takes in two (latitude, longitude) pairs and produces an int score.
|
|
|
+ Score is in the (inclusive) range [0, 5000]
|
|
|
+ Higher scores are closer.
|
|
|
+ Scoring is much more punishing than standard
|
|
|
+
|
|
|
+ Returns (score, distance in km)
|
|
|
+ """
|
|
|
+ dist_km = haversine.haversine(target, guess)
|
|
|
+ return max(0, 5000 - int(dist_km * 1000)), dist_km
|