pseudocode for all win conditions spelled out