mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
move to upstream PyPI pysol_cards
This commit is contained in:
parent
7d55cd045c
commit
5b80116b69
1 changed files with 3 additions and 24 deletions
|
@ -54,6 +54,7 @@
|
|||
import unittest
|
||||
|
||||
from pysol_cards.cards import Card, CardRenderer, ms_rearrange
|
||||
from pysol_cards.deal_game import Columns
|
||||
|
||||
# So the localpaths will be overrided.
|
||||
from pysollib.pysolrandom import LCRandom31, constructRandom, \
|
||||
|
@ -68,29 +69,6 @@ from pysollib.pysolrandom import LCRandom31, constructRandom, \
|
|||
# ************************************************************************/
|
||||
|
||||
|
||||
class Columns:
|
||||
|
||||
def __init__(self, num):
|
||||
self.num = num
|
||||
cols = []
|
||||
for i in range(num):
|
||||
cols.append([])
|
||||
|
||||
self.cols = cols
|
||||
|
||||
def add(self, idx, card):
|
||||
self.cols[idx].append(card)
|
||||
|
||||
def rev(self):
|
||||
self.cols.reverse()
|
||||
|
||||
def output(self):
|
||||
s = ''
|
||||
for column in self.cols:
|
||||
s += column_to_string(column) + "\n"
|
||||
return s
|
||||
|
||||
|
||||
class Board:
|
||||
def __init__(self, num_columns, with_freecells=False,
|
||||
with_talon=False, with_foundations=False):
|
||||
|
@ -134,7 +112,8 @@ class Board:
|
|||
s += self.print_foundations() + "\n"
|
||||
if (self.with_freecells):
|
||||
s += self.print_freecells() + "\n"
|
||||
s += self.columns.output()
|
||||
for c in self.columns.cols:
|
||||
s += ren.l_concat(c) + "\n"
|
||||
|
||||
return s
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue