The question is simple. I did something wrong but I can't find the solution. Am I missing something?
function harveyScrabble($mot){
$worth10Points = array("y","Y");
$worth5Points = array("v","V");
$worth3Points = array("h","H");
$worth2Points = array("r","R");
$worth1Point = array("a","A","b","B","c","C","d","D","e","E","f","F","g","G","i",
"I","j","J","k","K","l","L","m","M","n","N","o","O","p","P",
"q","Q","s","S","t","T","u","U","w","W","x","X","z","Z");
$total = 0;
for ($i=0; $i <count($mot) ; $i++) {
$char = $mot{i};
if (in_array($char, $worth10Points)) {
$total += 10;
}
elseif (in_array($char, $worth5Points)) {
$total += 5;
}
elseif (in_array($char, $worth3Points)) {
$total += 3;
}
elseif (in_array($char, $worth2Points)) {
$total += 2;
}
else{
$total += 1;
}
}
return $total;
}
When I try to called the function with the word "Harambe" it gives me only 3 points.