s0er3n / whenwasthisphototaken.com

1 stars 0 forks source link

New Feature Suggestion: Customizable year range for scoring. #7

Closed DeltaLeeds closed 1 year ago

DeltaLeeds commented 1 year ago
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main() {
    float year_range = 50; //This will be customizable in round 1. (Default at 50)
    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<=year_range;delta_year++){
        formula_one = 5000 - (5000 / (pow(year_range,2))) * pow(delta_year,2);
        formula_two =  (5000 / (pow(year_range,2))) * pow(year_range - 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;
}

Try here. In the final game result screen, show the scoring year range somewhere as well.

s0er3n commented 1 year ago

I thought about this a lot. I want to have the score comparable between games to later maybe add a score board.