# [R], 73 bytes <!-- language-all: lang-r --> function(m,n,d=t(diff(m)),w=which,x=w(d>0)%%n)any(x[seq(y<-w(d<0)%%n)]-y) [Try it online!][TIO-km3gajkh] [R]: https://www.r-project.org/ [TIO-km3gajkh]: https://tio.run/##jdG9joMwDAfw3U@RIlVKpLSyh9tIx3uJqgPiQzCQu0J6wNNzqOSMYTpl@SlRnH/sbq7cXL18Hpovr1vrbeGCLpqq0q0xdnBD3eS1Hd2gixua89mbzE96vPflU0/pZdlO1@3HZTJz67L@2maha0bdlVlxzfsfXbtPq/ry2yUqsSqUY3AJoIqLRVEktJ7SThS13iAh3AmjSIiAhFCIhFAI@TXk1/BdZRMK0VsoRFHE/ziK@JS4MnHlv6RSCIkxAKdlSlZ9LPp345HTytT8I5A5tm7yREBmEh2Dw7xgmxWJCRxyz78 "R – Try It Online" Based on the idea in [Leo's Husk answer](https://codegolf.stackexchange.com/a/220491/78274). Takes input as a matrix `m` of 1s and 0s with each pattern corresponding to a row, and the size of the pattern `n`. Outputs a swapped T/F value (in the footer, the results are swapped back).