You guys are gonna love this. The result of main is actually a matrix of strings, not integers, but it looks a bit nicer.
Every gate is connected to the gates it's supposed to, but for now they just overwrite each other when a connection is already taken. This is only in the matrix though (for integer values check matrix_val). In the route_list_x and route_list_y are all the correct routes.