shenzhen-solitaire.py
def from_str(string):
        """Produce a card from a string."""
        assert len(string) == 2

        if string[0] == ROSE:
            return Card(ROSE)

        if string[1] == CLEARED:
            return Card(CLEARED)

        color = string[0]

        if string[1] == DRAGON:
            return Card(DRAGON, color)

        return Card(NUMBER, color, int(string[1]))
Produce a card from a string.
Produce a card from a string.
Produce a card from a string .
def from_str(string):
        assert len(string) == 2
        if string[0] == ROSE:
            return Card(ROSE)
        if string[1] == CLEARED:
            return Card(CLEARED)
        color = string[0]
        if string[1] == DRAGON:
            return Card(DRAGON, color)
        return Card(NUMBER, color, int(string[1]))
def from_str ( string ) : assert len ( string ) == 2 if string [ 0 ] == ROSE : return Card ( ROSE ) if string [ 1 ] == CLEARED : return Card ( CLEARED ) color = string [ 0 ] if string [ 1 ] == DRAGON : return Card ( DRAGON , color ) return Card ( NUMBER , color , int ( string [ 1 ] ) )
Produce a card from a string.
Produce a card from a string .
"""Produce a card from a string."""
string