@staticmethod
def _sort_by_value(cards: list, order: str) ->list:
    """Sorts cards according to value. Uses selection sort"""
    unsorted_cards = cards.copy()
    sorted_cards = []
    sort_fx = min if order == 'asc' else max
    for _ in cards:
        smallest_card = sort_fx(unsorted_cards)
        unsorted_cards.remove(smallest_card)
        sorted_cards.append(smallest_card)
    return sorted_cards
