1""" Losers Variant""" 2 3from pychess.Utils.const import LOSERSCHESS, VARIANTS_OTHER_NONSTANDARD 4from pychess.Utils.Board import Board 5 6 7class LosersBoard(Board): 8 """:Description: The Losers variant is a game where the concept is to get rid of all your 9 pieces before you opponent does. On a players turn if a piece can be taken it must be taken 10 otherwise a normal chess move can be played 11 """ 12 variant = LOSERSCHESS 13 __desc__ = _("FICS losers: http://www.freechess.org/Help/HelpFiles/losers_chess.html") 14 name = _("Losers") 15 cecp_name = "losers" 16 need_initial_board = False 17 standard_rules = False 18 variant_group = VARIANTS_OTHER_NONSTANDARD 19 20 21def testKingOnly(board): 22 """ Checks to see if if a winning position has been acheived 23 """ 24 return bin(board.friends[board.color]).count("1") == 1 25