Identify the Game: reach the other side of the board, while avoiding barriers
Sounds like you are describing Quoridor.


  This abstract strategy is surprisingly deep for its simple rules. The
  object of the game is to advance your pawn to the opposite edge of the
  board. On your turn you may either move your pawn or place a wall. You
  may hinder your opponent with wall placement, but not completely block
  him off. Meanwhile, he is trying to do the same to you. First pawn to
  reach the opposite side wins.


There is a similar game called Blockade, but unlike Quoridor, the board for that one isn't square.