V
V
Vlad2015-10-05 19:28:19
PHP
Vlad, 2015-10-05 19:28:19

What is the best way to compare results?

I decided to write a prediction script for football matches, but the problem is, how best to compare the result and the prediction? For example, +1 point for the correct outcome, +2 points for the difference, +3 points for the result, nothing is guessed - 0. Which way to dig, look?
2 0 - forecast
4 2 - result
+2
1 1 - forecast
2 2 - result
+2
2 1 - forecast
0 3 - result
+0

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
javanub, 2015-10-05
@javanub

Well, what's stopping you from writing switch or if that if the result is a victory, then fulfill such a condition, etc.

M
Max, 2015-10-05
@MaxDukov

you will store in a DB? we make a table of predictions, a table of results and a table of points.
then we do a LEFT JOIN of the result table with the forecast table, JOIN the score table to them - and calculate the total score, grouping by the "forecaster" and the game.
profit

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question