Considering that you've named your squares as independent variables, there's not much you can do to generalize CheckWin(). Start by turning the board into an array or two-dimensional array, then read the advice in Tic-tac-toe Design . Personally, I like the suggestion to list all eight winning configurations, as it results in the least code.

I am too lazy to program it, but try programming tic tac toe instead of being in the "bruteforce" way, try making the winner the one who has at least 3 picks and the sum of his picks is 15(bad wording, I know). I'm going to save you on my blabbering and look at this: