Is there a way to extract the value based on a percentage?
Probability value:
Bad: 1%
Normal: 29%
Good: 70%
var move ["bad","normal","good"];
Simple conditional statement:
if (move == "bad") {
bad_move = "That a bad move!";
} else if (move == "normal") {
normal_move = "Classic move!";
} else {
good_move = "Amazing move!";
}
Then is PHP better than Javascript for this problem?
source
share