add win lose logic in ruby