I am writing a program that reads in a potential Latin Square and tells whether or not it is a valid latin square or not. Now I am trying tell if the region selected is a contiguous one or not.
The potential Latin Square and the location of the region are read in at the same time. The region [0,1][0,2][1,1][1,2]
would be a valid region because it is contiguous; [0,0][0,2][1,1][1,2]
would not be contiguous or valid because [0,0]
can't be reached. How would I tell if they are contiguous?