mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Convert to six.py
This commit is contained in:
parent
601bceb4da
commit
64720e8a97
1 changed files with 4 additions and 7 deletions
|
@ -22,8 +22,8 @@
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
# Imports
|
# Imports
|
||||||
import sys
|
|
||||||
from gettext import ungettext
|
from gettext import ungettext
|
||||||
|
from six.moves import range
|
||||||
|
|
||||||
# PySol imports
|
# PySol imports
|
||||||
from pysollib.mygettext import _
|
from pysollib.mygettext import _
|
||||||
|
@ -42,9 +42,6 @@ from pysollib.stack import \
|
||||||
AbstractFoundationStack, \
|
AbstractFoundationStack, \
|
||||||
InitialDealTalonStack
|
InitialDealTalonStack
|
||||||
|
|
||||||
if sys.version_info > (3,):
|
|
||||||
xrange = range
|
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# *
|
# *
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
|
@ -118,7 +115,7 @@ class Shisen_RowStack(Mahjongg_RowStack):
|
||||||
dx, dy = x2 - x1, y2 - y1
|
dx, dy = x2 - x1, y2 - y1
|
||||||
|
|
||||||
a = []
|
a = []
|
||||||
for i in xrange(cols+2):
|
for i in range(cols+2):
|
||||||
a.append([5]*(rows+2))
|
a.append([5]*(rows+2))
|
||||||
|
|
||||||
def can_move(x, y, nx, ny, direct, d, direct_chng_cnt):
|
def can_move(x, y, nx, ny, direct, d, direct_chng_cnt):
|
||||||
|
@ -349,12 +346,12 @@ class AbstractShisenGame(AbstractMahjonggGame):
|
||||||
self.check_dist = l.CW*l.CW + l.CH*l.CH # see _getClosestStack()
|
self.check_dist = l.CW*l.CW + l.CH*l.CH # see _getClosestStack()
|
||||||
|
|
||||||
#
|
#
|
||||||
self.cols = [[] for i in xrange(cols)]
|
self.cols = [[] for i in range(cols)]
|
||||||
cl = range(cols)
|
cl = range(cols)
|
||||||
if dx > 0:
|
if dx > 0:
|
||||||
cl.reverse()
|
cl.reverse()
|
||||||
for col in cl:
|
for col in cl:
|
||||||
for row in xrange(rows):
|
for row in range(rows):
|
||||||
x = l.XM + dxx + col * cardw
|
x = l.XM + dxx + col * cardw
|
||||||
y = l.YM + dyy + row * cardh
|
y = l.YM + dyy + row * cardh
|
||||||
stack = self.RowStack_Class(x, y, self)
|
stack = self.RowStack_Class(x, y, self)
|
||||||
|
|
Loading…
Add table
Reference in a new issue