ttt: add victory condition checking