Did I find the right examples for you? yes no      Crawl my project      Python Jobs

# Card.twoStartCards

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
```Function to convert 2 value,suit pairs into a Holdem style starting hand e.g. AQo
Incoming values should be ints 2-14 (2,3,...K,A), suits are 'd'/'h'/'c'/'s'
Hand is stored as an int 13 * x + y + 1 where (x+2) represents rank of 1st card and
(y+2) represents rank of second card (2=2 .. 14=Ace)
If x > y then pair is suited, if x < y then unsuited
Examples:
1  22
2  32o
3  42o
...(more...)
```

```        def twoStartCards(value1, suit1, value2, suit2):
""" Function to convert 2 value,suit pairs into a Holdem style starting hand e.g. AQo
Incoming values should be ints 2-14 (2,3,...K,A), suits are 'd'/'h'/'c'/'s'
Hand is stored as an int 13 * x + y + 1 where (x+2) represents rank of 1st card and
(y+2) represents rank of second card (2=2 .. 14=Ace)
If x > y then pair is suited, if x < y then unsuited
Examples:
1  22
2  32o
3  42o
...
14  32s
15  33
16  42o
...
169  AA
170  Unknown / Illegal cards
"""
if value1 is None or value1 < 2 or value1 > 14 or value2 is None or value2 < 2 or value2 > 14:
ret = 170
elif value1 == value2: # pairs
ret = (13 * (value2-2) + (value2-2) ) + 1
elif suit1 == suit2:
if value1 > value2:
ret = 13 * (value1-2) + (value2-2) + 1
else:
ret = 13 * (value2-2) + (value1-2) + 1
else:
if value1 > value2:
ret = 13 * (value2-2) + (value1-2) + 1
else:
ret = 13 * (value1-2) + (value2-2) + 1

#    print "twoStartCards(", value1, suit1, value2, suit2, ")=", ret
return ret
```

```        value1 = Card.card_map[hcs[0][0]]