Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/cardsort.py
diff options
context:
space:
mode:
authorWalter Bender <walter@walter-laptop.(none)>2009-11-04 01:29:04 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2009-11-04 01:29:04 (GMT)
commitd1af87966cca28ead97433c31c6a92a15cf532fc (patch)
treecdd0301d917b8378cff509029b07c057b8173d02 /cardsort.py
parent19a5d42250e7c4b2225983f2d3542cb125dcbd91 (diff)
remove blank card support
Diffstat (limited to 'cardsort.py')
-rwxr-xr-xcardsort.py20
1 files changed, 6 insertions, 14 deletions
diff --git a/cardsort.py b/cardsort.py
index 70e7b00..a9c6d80 100755
--- a/cardsort.py
+++ b/cardsort.py
@@ -45,9 +45,11 @@ class CardSortMain:
self.win.connect("delete_event", lambda w,e: gtk.main_quit())
menu = gtk.Menu()
+ """
menu_items = gtk.MenuItem(_("Toggle blank card"))
menu.append(menu_items)
menu_items.connect("activate", self._toggle_card_cb)
+ """
menu_items = gtk.MenuItem(_("Apply rotation sets"))
menu.append(menu_items)
menu_items.connect("activate", self._apply_rotation_sets_cb)
@@ -84,17 +86,16 @@ class CardSortMain:
def set_title(self, title):
self.win.set_title(title)
- # Print a string when a menu item is selected
+ """
def _toggle_card_cb(self, widget):
self.tw.grid.toggle_blank()
sprites.redrawsprites(self.tw)
+ """
def _apply_rotation_sets_cb(self, widget):
self.rotation_sets = get_rotation_sets()
i = self.r
for j in range(9):
- # if the blank card (9) is in the grid,
- # then the index for the card it replaced will fail
try:
self.tw.grid.card_table[self.tw.grid.grid.index(j)]\
.set_orientation(self.rotation_sets[i][j])
@@ -105,15 +106,6 @@ class CardSortMain:
if self.r == 64:
self.r = 0
- def _solve_cb_x(self, widget):
- self.tw.grid.set_grid([8,7,6,5,4,3,2,1,0,9])
- self.tw.grid.print_grid()
-
- self.tw.grid.set_orientation([0,90,180,270,0,90,180,270,0,90])
- self.tw.grid.print_orientations()
- sprites.redrawsprites(self.tw)
- return True
-
def _solve_cb(self, widget):
self.rotation_sets = get_rotation_sets()
counter = 0
@@ -133,13 +125,13 @@ class CardSortMain:
for r in range(9):
self.tw.grid.card_table[self.tw.grid.grid.index(r)]\
.set_orientation(self.rotation_sets[o][r],False)
- if self.tw.grid.test() is True:
+ if self.tw.test() is True:
print _("You solved the puzzle.")
self.tw.grid.print_grid()
self.tw.grid.print_orientations()
self.tw.win.set_title(_("CardSort") + ": " + \
_("You solved the puzzle."))
- self.tw.grid.reset(self.tw)
+ self.tw.grid.reset3x3(self.tw)
self.tw.grid.set_grid(g)
for r in range(9):
self.tw.grid.card_table[self.tw.grid.grid.index(r)]\