Added win and lose logic.

Signed-off-by: Larry Zhao <larrylzhao@gmail.com>