     })
 
   update_msg: ->
-    if @maze.is_target([@x, @y, @z])
+    if @maze.is_finish([@x, @y, @z])
       msg = MazeUI3D.msg['win']
     else if @maze.passage_exists([[@x, @y, @z], [@x, @y, @z + 1]]) or @maze.passage_exists([[@x, @y, @z - 1], [@x, @y, @z]])
       msg = MazeUI3D.msg['updown']

            context.lineWidth = 1
            context.strokeStyle = 'black'
            context.stroke()
          if @maze.is_target([x, y, z])
            # paint target
            context.beginPath()
            context.arc(71 * x + 71 / 2, 71 * y + 71 / 2, 21, 0, 2 * Math.PI, false)
            context.lineWidth = 10

  passage_exists: (passage) ->
    passage of @passages

  is_finish: (cell) ->
    cell of @finishes

class MazeUI3D
