Zsh, 207 ... 158 bytes
Version history: 4 iterations for ~25 bytes first week; then 3 more iterations for ~25 bytes 6 months later, 1 more for 1 byte 11 months later.
t(){a=($^a-$^@_);for s l (${w:^^argv}){s+=$l;i=;repeat $#s a[++i]+=$s[i+1];}}
w=(+)
t $@
for s;w[++j]=${(l:j:)}_
t $@
t ${(Oa)@}
[[ $a = *XXXX* ]]&&<<<X||<<<Y
(first)
(second)
(third)
(fourth)
(fifth)
(sixth)
(seventh)
(eigth)
In the footer, I print both the input board and the array we build from it to stderr. Scroll down to debug to see them. The array we build is a lot longer now, since t
does a cartesian product with input board on every call. (Hey, it shortened the code by a few bytes.)
There's a lot to cover here, so I moved the (sixth edition) comments to an annotated gist.
(tl;dr: concatenate transpositions of the original array, but make sure to keep them separated)