Skip to content

Commit

Permalink
Fix out of range warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mwatson committed Jul 20, 2015
1 parent b36f858 commit cee195c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/BoggleSolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ public function loadDict()

for ($i = 0; $i < $wordLen; $i++) {
$letter = $word[$i];
if ($letter == 'Q' && isset($words[$i + 1]) && $word[$i + 1] == 'U') {
$letter = 'Qu';
$i++;
if ($letter == 'Q' && isset($words[$i + 1])) {
if ($word[$i + 1] == 'U') {
$letter = 'Qu';
$i++;
}
}
if (!isset($ptr[$letter])) {
$ptr[$letter] = array();
Expand Down

0 comments on commit cee195c

Please sign in to comment.