Java east to west and west to east finder
<p>This code can find a word if it goes from LEFT to RIGHT, how can I change it to find a word from Right to left and from top to bottom?</p>

<pre><code>boolean findWE(String word) {
  for (int r = 0; r &lt; height; r++) {
    for (int c = 0; c &lt;= width - word.length(); c++) {
      if (word.charAt(0) == grid[r][c]) {
        boolean failed = false;
        for (int i = 0; i &lt; word.length() &amp;&amp; !failed; i++) {
          if (word.charAt(i) != grid[r][c + i]) {
            failed = true;
          }
        }
        if (!failed) {
          System.out.printf("%s found WE at(%d,%d)\n", word, r, c);
          return true;
        }
      }
    }
  }
  return false;
}
</code></pre>
