added pattern creation function for endGame matching, plus some utility
function that will be used in endGame matching
added horizontal win detection for any size