Computer randomly generates a "path" taken in a matrix