s0er3n / whenwasthisphototaken.com

1 stars 0 forks source link

Suggestion: Scores are too lenient. #3

Open DeltaLeeds opened 1 year ago

DeltaLeeds commented 1 year ago

I personally find that the score range should reach 0 when the year guessed is 50 years more or less than the actual year.

Formulas I... formulated: Δyear = Absolute(real_year - guessed_year)

More exponential / complex formula:

s0er3n commented 1 year ago
fn calculate_score(real_year: f64, guessed_year: f64) -> f64 {
    5000.0 * f64::exp(-f64::abs(real_year - guessed_year) as f64 / (MAX_YEAR - MIN_YEAR) as f64)
}

this is the current function @DeltaLeeds

DeltaLeeds commented 1 year ago

Here's how you can test out the formula in this c playground site

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main() {
    float formula_one;
    float formula_two;
    float formula_one_weight = 1.25;
    float formula_two_weight = 0.75;
    for (int delta_year = 0;delta_year<=50;delta_year++){
        formula_one = 5000 - 2 * pow(delta_year,2);
        formula_two =  2 * pow(50 - delta_year, 2);
        float result = (formula_one * formula_one_weight + formula_two * formula_two_weight)/2;
        printf("Year difference with result: %i\nFormula 1 score: %f\nFormula 2 score: %f\nResult: %f\n\n", delta_year, formula_one, formula_two, result);
    }

    return 0;
}
s0er3n commented 1 year ago

@DeltaLeeds I think scores are almost perfect but i would like to have it a bit harsher

s0er3n commented 1 year ago

https://github.com/s0er3n/whenwasthisphototaken.com/blob/fff5e0c9224ceccaf165aaa682c9b7b46bd5bc07/src/game.rs#L17 here is the code