Play a crossword puzzle in a curses grid. Takes a command line argument of the
crossword puzzle file.
"""
+# curses_crossword.py - play crosswords in a terminal
+# Copyright (C) 2009 Brett Parker <iDunno@sommitrealweird.co.uk>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import curses
import curses.ascii
if cluescury < cluespad.getmaxyx()[0] - (padbry - padtly):
cluescury += 1
cluespad.refresh(cluescury, 0, padtly, padtlx, padbry - 1, padbrx - 1)
+ stdscr.refresh()
if inch == curses.KEY_PPAGE:
if cluescury > 0:
cluescury -= 1
cluespad.refresh(cluescury, 0, padtly, padtlx, padbry - 1, padbrx - 1)
+ stdscr.refresh()
if inch == curses.KEY_RIGHT:
if gridx < (len(crossword["grid"][0]) - 1):
gridx += 1