mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-15 02:54:09 -04:00
Fix some typos as reported by codespell.
Thanks to Jan for inspiring this.
This commit is contained in:
parent
2d6d4b5c8a
commit
c1d7918c27
21 changed files with 35 additions and 35 deletions
|
@ -122,7 +122,7 @@ The toolkit layer
|
||||||
ship with every Python installation, but a very experimental version
|
ship with every Python installation, but a very experimental version
|
||||||
for Gnome (using the pygnome and pygtk bindings) exists as well.
|
for Gnome (using the pygnome and pygtk bindings) exists as well.
|
||||||
|
|
||||||
A more exicting idea is to use JPython to make PySol run under a
|
A more exciting idea is to use JPython to make PySol run under a
|
||||||
Java VM using Swing as the toolkit.
|
Java VM using Swing as the toolkit.
|
||||||
|
|
||||||
Because Tkinter is the "main" interface other toolkit layers have
|
Because Tkinter is the "main" interface other toolkit layers have
|
||||||
|
|
|
@ -19,7 +19,7 @@ more than eight cards in a row.
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The cards in the tableau build from first rank to fourth, without regard
|
The cards in the tableau build from first rank to fourth, without regard
|
||||||
to suit. The third and fourth rank cards are interchangable. Any card
|
to suit. The third and fourth rank cards are interchangeable. Any card
|
||||||
can be played on the canvas.
|
can be played on the canvas.
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -11,7 +11,7 @@ Move all cards to the foundations.
|
||||||
Cards can be played on the tableau by suits or by rank.
|
Cards can be played on the tableau by suits or by rank.
|
||||||
Plum 1 plays on Pine 1, Maple 3 on Mum 3, Pine 2 on
|
Plum 1 plays on Pine 1, Maple 3 on Mum 3, Pine 2 on
|
||||||
Phoenix 2, etc. Any second rank card can be played on
|
Phoenix 2, etc. Any second rank card can be played on
|
||||||
any first. The third and fourth ranks are interchangable
|
any first. The third and fourth ranks are interchangeable
|
||||||
for all suits. Only first rank cards can be played on the
|
for all suits. Only first rank cards can be played on the
|
||||||
canvas. There can be no more than 26 cards in a row.
|
canvas. There can be no more than 26 cards in a row.
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -8,7 +8,7 @@ Arrange all the cards on the rows.
|
||||||
This is a <a href="fan.html">Fan</a>
|
This is a <a href="fan.html">Fan</a>
|
||||||
type game adapted to the Hanafuda cards. The tableau consists of
|
type game adapted to the Hanafuda cards. The tableau consists of
|
||||||
twelve rows. Any stack may be moved, but only a first rank card
|
twelve rows. Any stack may be moved, but only a first rank card
|
||||||
will play on an empty row. The trash cards are not interchangable,
|
will play on an empty row. The trash cards are not interchangeable,
|
||||||
and no more than eight cards can be played on a row. The game is
|
and no more than eight cards can be played on a row. The game is
|
||||||
won when all twelve suits are arranged in order in their respective
|
won when all twelve suits are arranged in order in their respective
|
||||||
places on the tableau.
|
places on the tableau.
|
||||||
|
|
|
@ -10,7 +10,7 @@ Move all cards to the foundation.
|
||||||
<p>
|
<p>
|
||||||
The cards can only be moved to the foundation as entire suits, in order.
|
The cards can only be moved to the foundation as entire suits, in order.
|
||||||
As in <a href="oonsoo.html">Oonsoo</a>,
|
As in <a href="oonsoo.html">Oonsoo</a>,
|
||||||
the third and fourth rank cards are interchangable
|
the third and fourth rank cards are interchangeable
|
||||||
for all suits except Rain. Only first rank cards can play on the canvas.
|
for all suits except Rain. Only first rank cards can play on the canvas.
|
||||||
First build the suits on the tableau. Then pick up all four cards at
|
First build the suits on the tableau. Then pick up all four cards at
|
||||||
once and drop them on the foundation. The foundation will only accept
|
once and drop them on the foundation. The foundation will only accept
|
||||||
|
|
|
@ -10,9 +10,9 @@ Arrange all twelve suits in order.
|
||||||
<p>
|
<p>
|
||||||
When the hand is dealt there are two rows of six cards face down with
|
When the hand is dealt there are two rows of six cards face down with
|
||||||
six more face up on top. You can play a card on another card if it's
|
six more face up on top. You can play a card on another card if it's
|
||||||
in the same suit and in decending rank order. The third and fourth
|
in the same suit and in descending rank order. The third and fourth
|
||||||
rank cards are interchangable for all suits except Rain. Plum 4 on
|
rank cards are interchangeable for all suits except Rain. Plum 4 on
|
||||||
Plum 3 is ok. Plum 3 on Plum 4 is ok. Gaji can only be played on
|
Plum 3 is OK. Plum 3 on Plum 4 is OK. Gaji can only be played on
|
||||||
Rain 3.
|
Rain 3.
|
||||||
|
|
||||||
<h3>Strategy</h3>
|
<h3>Strategy</h3>
|
||||||
|
|
|
@ -10,8 +10,8 @@ Arrange all twelve suits in order.
|
||||||
<p>
|
<p>
|
||||||
When the hand is dealt there are two rows of six cards face down with
|
When the hand is dealt there are two rows of six cards face down with
|
||||||
six more face up on top. You can play a card on another card if it's
|
six more face up on top. You can play a card on another card if it's
|
||||||
in the same suit and in decending rank order. The third and fourth
|
in the same suit and in descending rank order. The third and fourth
|
||||||
rank cards are interchangable for all suits except Rain. Plum 4 on
|
rank cards are interchangeable for all suits except Rain. Plum 4 on
|
||||||
Plum 3 is ok. Plum 3 on Plum 4 is ok. Gaji can only be played on
|
Plum 3 is ok. Plum 3 on Plum 4 is ok. Gaji can only be played on
|
||||||
Rain 3.
|
Rain 3.
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ sequence of cards as a unit to another pile with an appropriate card (e.g.
|
||||||
<p>
|
<p>
|
||||||
When all possible moves are made (or the player has done all the possible
|
When all possible moves are made (or the player has done all the possible
|
||||||
moves one can make), the piles are picked up in reverse order. For example,
|
moves one can make), the piles are picked up in reverse order. For example,
|
||||||
the twelth pile is placed over the eleventh pile, and this new pile is placed
|
the twelfth pile is placed over the eleventh pile, and this new pile is placed
|
||||||
on the tenth pile, and so on. Then, without shuffling, the cards are dealt to
|
on the tenth pile, and so on. Then, without shuffling, the cards are dealt to
|
||||||
as many piles of four as the remaining decks will allow. To ensure that the
|
as many piles of four as the remaining decks will allow. To ensure that the
|
||||||
order of the cards is not disturbed for the most part, it is suggested that
|
order of the cards is not disturbed for the most part, it is suggested that
|
||||||
|
|
|
@ -261,7 +261,7 @@ class DuplicateError(ConfigObjError):
|
||||||
|
|
||||||
class ConfigspecError(ConfigObjError):
|
class ConfigspecError(ConfigObjError):
|
||||||
"""
|
"""
|
||||||
An error occured whilst parsing a configspec.
|
An error occurred whilst parsing a configspec.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class InterpolationError(ConfigObjError):
|
class InterpolationError(ConfigObjError):
|
||||||
|
@ -791,7 +791,7 @@ class Section(dict):
|
||||||
unless ``raise_errors=False``, in which case set the return value to
|
unless ``raise_errors=False``, in which case set the return value to
|
||||||
``False``.
|
``False``.
|
||||||
|
|
||||||
Any unrecognised keyword arguments you pass to walk, will be pased on
|
Any unrecognised keyword arguments you pass to walk, will be passed on
|
||||||
to the function you pass in.
|
to the function you pass in.
|
||||||
|
|
||||||
Note: if ``call_on_sections`` is ``True`` then - on encountering a
|
Note: if ``call_on_sections`` is ``True`` then - on encountering a
|
||||||
|
@ -1600,7 +1600,7 @@ class ConfigObj(Section):
|
||||||
Handle an error according to the error settings.
|
Handle an error according to the error settings.
|
||||||
|
|
||||||
Either raise the error or store it.
|
Either raise the error or store it.
|
||||||
The error will have occured at ``cur_index``
|
The error will have occurred at ``cur_index``
|
||||||
"""
|
"""
|
||||||
line = infile[cur_index]
|
line = infile[cur_index]
|
||||||
cur_index += 1
|
cur_index += 1
|
||||||
|
|
|
@ -863,7 +863,7 @@ def is_boolean(value):
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise VdtTypeError(value)
|
raise VdtTypeError(value)
|
||||||
# we do an equality test rather than an identity test
|
# we do an equality test rather than an identity test
|
||||||
# this ensures Python 2.2 compatibilty
|
# this ensures Python 2.2 compatibility
|
||||||
# and allows 0 and 1 to represent True and False
|
# and allows 0 and 1 to represent True and False
|
||||||
if value == False:
|
if value == False:
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -1980,7 +1980,7 @@ Congratulations, you did it !
|
||||||
to_stack, ncards = s.canDropCards(self.s.foundations)
|
to_stack, ncards = s.canDropCards(self.s.foundations)
|
||||||
if to_stack:
|
if to_stack:
|
||||||
# each single drop is undo-able (note that this call
|
# each single drop is undo-able (note that this call
|
||||||
# is before the acutal move)
|
# is before the actual move)
|
||||||
self.finishMove()
|
self.finishMove()
|
||||||
if sound:
|
if sound:
|
||||||
self.playSample("autodrop", priority=30)
|
self.playSample("autodrop", priority=30)
|
||||||
|
|
|
@ -28,7 +28,7 @@ import sys
|
||||||
from Tkinter import Menu, Text, TclError
|
from Tkinter import Menu, Text, TclError
|
||||||
|
|
||||||
def runningAsOSXApp():
|
def runningAsOSXApp():
|
||||||
""" Returns True iff running from the PySol.app bundle on OSX """
|
""" Returns True if-and-only-if running from the PySol.app bundle on OSX """
|
||||||
return (sys.platform == 'darwin' and 'PySol.app' in sys.argv[0])
|
return (sys.platform == 'darwin' and 'PySol.app' in sys.argv[0])
|
||||||
|
|
||||||
def hideTkConsole(root):
|
def hideTkConsole(root):
|
||||||
|
|
|
@ -48,7 +48,7 @@ class AtomicMove:
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return str(self.__dict__)
|
return str(self.__dict__)
|
||||||
|
|
||||||
# Custom comparision for detecting redo moves. See Game.finishMove().
|
# Custom comparison for detecting redo moves. See Game.finishMove().
|
||||||
def cmpForRedo(self, other):
|
def cmpForRedo(self, other):
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
|
|
|
@ -409,7 +409,7 @@ class SelectGameDialogWithPreview(MfxDialog):
|
||||||
self.preview_app.opt.shadow = 0
|
self.preview_app.opt.shadow = 0
|
||||||
self.preview_app.opt.shade = 0
|
self.preview_app.opt.shade = 0
|
||||||
#
|
#
|
||||||
self.preview_app.audio = None # turn off audio for intial dealing
|
self.preview_app.audio = None # turn off audio for initial dealing
|
||||||
if animations >= 0:
|
if animations >= 0:
|
||||||
self.preview_app.opt.animations = animations
|
self.preview_app.opt.animations = animations
|
||||||
#
|
#
|
||||||
|
|
|
@ -340,7 +340,7 @@ class Cardset(Resource):
|
||||||
nbottoms = 7,
|
nbottoms = 7,
|
||||||
nletters = 4,
|
nletters = 4,
|
||||||
nshadows = 1 + 13,
|
nshadows = 1 + 13,
|
||||||
# selection criterias
|
# selection criteria
|
||||||
si = si,
|
si = si,
|
||||||
# implicit
|
# implicit
|
||||||
backname = None,
|
backname = None,
|
||||||
|
|
|
@ -454,16 +454,16 @@ class Stack:
|
||||||
self.closeStack()
|
self.closeStack()
|
||||||
return card
|
return card
|
||||||
|
|
||||||
def insertCard(self, card, positon, unhide=1, update=1):
|
def insertCard(self, card, position, unhide=1, update=1):
|
||||||
model, view = self, self
|
model, view = self, self
|
||||||
model.cards.insert(positon, card)
|
model.cards.insert(position, card)
|
||||||
for c in model.cards[positon:]:
|
for c in model.cards[position:]:
|
||||||
c.tkraise(unhide=unhide)
|
c.tkraise(unhide=unhide)
|
||||||
if view.can_hide_cards and len(model.cards) >= 3 and len(model.cards)-positon <= 2:
|
if view.can_hide_cards and len(model.cards) >= 3 and len(model.cards)-position <= 2:
|
||||||
# we only need to display the 2 top cards
|
# we only need to display the 2 top cards
|
||||||
model.cards[-3].hide(self)
|
model.cards[-3].hide(self)
|
||||||
card.item.addtag(view.group)
|
card.item.addtag(view.group)
|
||||||
for c in model.cards[positon:]:
|
for c in model.cards[position:]:
|
||||||
view._position(c)
|
view._position(c)
|
||||||
if update:
|
if update:
|
||||||
view.updateText()
|
view.updateText()
|
||||||
|
|
|
@ -60,13 +60,13 @@ class PysolStatsFormatter:
|
||||||
}
|
}
|
||||||
sort_func = sort_functions[sort_by]
|
sort_func = sort_functions[sort_by]
|
||||||
g = sort_func(player=player)
|
g = sort_func(player=player)
|
||||||
twon, tlost, tgames, ttime, tmoves = 0, 0, 0, 0, 0
|
t_won, tlost, tgames, ttime, tmoves = 0, 0, 0, 0, 0
|
||||||
for id in g:
|
for id in g:
|
||||||
won, lost, time, moves = app.stats.getFullStats(player, id)
|
won, lost, time, moves = app.stats.getFullStats(player, id)
|
||||||
if won > 0 or lost > 0 or id == app.game.id:
|
if won > 0 or lost > 0 or id == app.game.id:
|
||||||
# yield only played games
|
# yield only played games
|
||||||
name = app.getGameTitleName(id)
|
name = app.getGameTitleName(id)
|
||||||
twon, tlost = twon + won, tlost + lost
|
t_won, tlost = t_won + won, tlost + lost
|
||||||
ttime, tmoves = ttime+time, tmoves+moves
|
ttime, tmoves = ttime+time, tmoves+moves
|
||||||
if won + lost > 0:
|
if won + lost > 0:
|
||||||
perc = "%.1f" % (100.0 * won / (won + lost))
|
perc = "%.1f" % (100.0 * won / (won + lost))
|
||||||
|
@ -77,7 +77,7 @@ class PysolStatsFormatter:
|
||||||
yield [name, won+lost, won, lost, t, m, perc, id]
|
yield [name, won+lost, won, lost, t, m, perc, id]
|
||||||
tgames += 1
|
tgames += 1
|
||||||
# summary
|
# summary
|
||||||
won, lost = twon, tlost
|
won, lost = t_won, tlost
|
||||||
if won + lost > 0:
|
if won + lost > 0:
|
||||||
if won > 0:
|
if won > 0:
|
||||||
time = format_time(ttime/tgames)
|
time = format_time(ttime/tgames)
|
||||||
|
@ -111,7 +111,7 @@ class PysolStatsFormatter:
|
||||||
return _("Game"), _("Game number"), _("Started at"), _("Status")
|
return _("Game"), _("Game number"), _("Started at"), _("Status")
|
||||||
|
|
||||||
def getLogResults(self, player, prev_games):
|
def getLogResults(self, player, prev_games):
|
||||||
twon, tlost = 0, 0
|
t_won, tlost = 0, 0
|
||||||
for pg in prev_games:
|
for pg in prev_games:
|
||||||
if not isinstance(pg, tuple):
|
if not isinstance(pg, tuple):
|
||||||
continue
|
continue
|
||||||
|
@ -144,7 +144,7 @@ class PysolStatsFormatter:
|
||||||
date = time.strftime("%Y-%m-%d %H:%M", time.localtime(pg[3]))
|
date = time.strftime("%Y-%m-%d %H:%M", time.localtime(pg[3]))
|
||||||
if pg[2] >= 0:
|
if pg[2] >= 0:
|
||||||
won = pg[2] > 0
|
won = pg[2] > 0
|
||||||
twon, tlost = twon + won, tlost + (1 - won)
|
t_won, tlost = t_won + won, tlost + (1 - won)
|
||||||
status = "*error*"
|
status = "*error*"
|
||||||
if -2 <= pg[2] <= 2:
|
if -2 <= pg[2] <= 2:
|
||||||
status = (_("Loaded"), _("Not won"), _("Lost"), _("Won"), _("Perfect")) [pg[2]+2]
|
status = (_("Loaded"), _("Not won"), _("Lost"), _("Won"), _("Perfect")) [pg[2]+2]
|
||||||
|
|
|
@ -489,7 +489,7 @@ class SelectGameDialogWithPreview(SelectGameDialog):
|
||||||
self.preview_app.opt.shadow = 0
|
self.preview_app.opt.shadow = 0
|
||||||
self.preview_app.opt.shade = 0
|
self.preview_app.opt.shade = 0
|
||||||
#
|
#
|
||||||
self.preview_app.audio = None # turn off audio for intial dealing
|
self.preview_app.audio = None # turn off audio for initial dealing
|
||||||
if animations >= 0:
|
if animations >= 0:
|
||||||
self.preview_app.opt.animations = animations
|
self.preview_app.opt.animations = animations
|
||||||
#
|
#
|
||||||
|
|
|
@ -693,7 +693,7 @@ class Combobox(Entry):
|
||||||
textvariable, values, width
|
textvariable, values, width
|
||||||
"""
|
"""
|
||||||
# The "values" option may need special formatting, so leave to
|
# The "values" option may need special formatting, so leave to
|
||||||
# _format_optdict the responsability to format it
|
# _format_optdict the responsibility to format it
|
||||||
if "values" in kw:
|
if "values" in kw:
|
||||||
kw["values"] = _format_optdict({'v': kw["values"]})[1]
|
kw["values"] = _format_optdict({'v': kw["values"]})[1]
|
||||||
|
|
||||||
|
@ -1023,7 +1023,7 @@ class Progressbar(Widget):
|
||||||
"""Begin autoincrement mode: schedules a recurring timer event
|
"""Begin autoincrement mode: schedules a recurring timer event
|
||||||
that calls method step every interval milliseconds.
|
that calls method step every interval milliseconds.
|
||||||
|
|
||||||
interval defaults to 50 milliseconds (20 steps/second) if ommited."""
|
interval defaults to 50 milliseconds (20 steps/second) if ommitted."""
|
||||||
self.tk.call(self._w, "start", interval)
|
self.tk.call(self._w, "start", interval)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -490,7 +490,7 @@ class SelectGameDialogWithPreview(SelectGameDialog):
|
||||||
self.preview_app.opt.shadow = 0
|
self.preview_app.opt.shadow = 0
|
||||||
self.preview_app.opt.shade = 0
|
self.preview_app.opt.shade = 0
|
||||||
#
|
#
|
||||||
self.preview_app.audio = None # turn off audio for intial dealing
|
self.preview_app.audio = None # turn off audio for initial dealing
|
||||||
if animations >= 0:
|
if animations >= 0:
|
||||||
self.preview_app.opt.animations = animations
|
self.preview_app.opt.animations = animations
|
||||||
#
|
#
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#
|
#
|
||||||
# python make_pysol_freecell_board.py [board number] | fc-solve
|
# python make_pysol_freecell_board.py [board number] | fc-solve
|
||||||
#
|
#
|
||||||
# This program is platform independant and will generate the same results
|
# This program is platform independent and will generate the same results
|
||||||
# on all architectures and operating systems.
|
# on all architectures and operating systems.
|
||||||
#
|
#
|
||||||
# Based on the code by Markus Franz Xaver Johannes Oberhumer.
|
# Based on the code by Markus Franz Xaver Johannes Oberhumer.
|
||||||
|
|
Loading…
Add table
Reference in a new issue