mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
fix some sorting regressions in flake8 commits
This commit is contained in:
parent
d0b79131ab
commit
cb646c3155
5 changed files with 7 additions and 6 deletions
|
@ -606,7 +606,7 @@ class Formic(TamOShanter):
|
||||||
cards.remove(c)
|
cards.remove(c)
|
||||||
if len(suits) == 4:
|
if len(suits) == 4:
|
||||||
break
|
break
|
||||||
top_cards.sort(key=lambda x: x.suit) # sort by suit
|
top_cards.sort(key=lambda x: -x.suit) # sort by suit
|
||||||
return cards+top_cards
|
return cards+top_cards
|
||||||
|
|
||||||
def startGame(self):
|
def startGame(self):
|
||||||
|
|
|
@ -406,7 +406,7 @@ class SeniorWrangler(Game):
|
||||||
ranks.append(c.rank)
|
ranks.append(c.rank)
|
||||||
cards.remove(c)
|
cards.remove(c)
|
||||||
top.append(c)
|
top.append(c)
|
||||||
top.sort(key=lambda x: x.rank)
|
top.sort(key=lambda x: -x.rank)
|
||||||
return cards+top
|
return cards+top
|
||||||
|
|
||||||
def startGame(self):
|
def startGame(self):
|
||||||
|
@ -470,7 +470,7 @@ class SPatience(Game):
|
||||||
ranks.append(c.rank)
|
ranks.append(c.rank)
|
||||||
cards.remove(c)
|
cards.remove(c)
|
||||||
top.append(c)
|
top.append(c)
|
||||||
top.sort(key=lambda x: x.rank)
|
top.sort(key=lambda x: -x.rank)
|
||||||
return cards+top[7:]+top[:7]
|
return cards+top[7:]+top[:7]
|
||||||
|
|
||||||
def startGame(self):
|
def startGame(self):
|
||||||
|
|
|
@ -122,7 +122,7 @@ class GrandfathersClock(Game):
|
||||||
clocks.append(c)
|
clocks.append(c)
|
||||||
cards.remove(c)
|
cards.remove(c)
|
||||||
# sort clocks reverse by rank
|
# sort clocks reverse by rank
|
||||||
clocks.sort(key=lambda x: x.rank)
|
clocks.sort(key=lambda x: -x.rank)
|
||||||
return clocks + cards
|
return clocks + cards
|
||||||
|
|
||||||
def startGame(self):
|
def startGame(self):
|
||||||
|
@ -471,7 +471,7 @@ class BigBen(Game):
|
||||||
if not t:
|
if not t:
|
||||||
break
|
break
|
||||||
# sort clocks reverse by rank
|
# sort clocks reverse by rank
|
||||||
clocks.sort(key=lambda x: x.rank)
|
clocks.sort(key=lambda x: -x.rank)
|
||||||
return cards+clocks
|
return cards+clocks
|
||||||
|
|
||||||
def startGame(self):
|
def startGame(self):
|
||||||
|
|
|
@ -553,7 +553,7 @@ class VirginiaReel(RoyalParade):
|
||||||
bottom_cards.append(c)
|
bottom_cards.append(c)
|
||||||
if len(ranks) == 3:
|
if len(ranks) == 3:
|
||||||
break
|
break
|
||||||
bottom_cards = sorted(bottom_cards, key=lambda x: x.rank)[::-1]
|
bottom_cards.sort(key=lambda x: -x.rank)
|
||||||
return cards+bottom_cards
|
return cards+bottom_cards
|
||||||
|
|
||||||
def startGame(self):
|
def startGame(self):
|
||||||
|
|
|
@ -92,6 +92,7 @@ def by_category():
|
||||||
games_by_cat[gt] = 1
|
games_by_cat[gt] = 1
|
||||||
games_by_cat_list = [(i, j) for i, j in games_by_cat.items()]
|
games_by_cat_list = [(i, j) for i, j in games_by_cat.items()]
|
||||||
games_by_cat_list.sort(key=lambda x: x[1])
|
games_by_cat_list.sort(key=lambda x: x[1])
|
||||||
|
games_by_cat_list = games_by_cat_list[::-1]
|
||||||
# print '<table border="2"><tr><th>Name</th><th>Number</th></tr>'
|
# print '<table border="2"><tr><th>Name</th><th>Number</th></tr>'
|
||||||
# for i in games_by_cat_list:
|
# for i in games_by_cat_list:
|
||||||
# print '<tr><td>%s</td><td>%s</td></tr>' % i
|
# print '<tr><td>%s</td><td>%s</td></tr>' % i
|
||||||
|
|
Loading…
Add table
Reference in a new issue