title: inserting faulty message whilst list index is out of range
body: <p>I want <code>this was wrong try again!</code> to print when the input value is not on the board, yet somehow, instead of the printed message to show up when I choose a value outside of the board, the code breaks. </p>
  
  <pre><code>    def legalMove(self):
              if self.board[startX][startY] != False:
  
  
      def playerMove(self,tile): 
                  if self.legalMove(tile, x, y) == False:
                      continue
                  else:
                      break
              else:
                  print('this was wrong try again!.')
          return [x, y]
  </code></pre>
  
  <p>the error</p>
  
  <blockquote>
    <p>if self.board[startX][startY] != ' ' or not self.isOnBoard(startX, startY):
    IndexError: list index out of range</p>
  </blockquote>