From: Brett Parker Date: Wed, 1 Jul 2009 22:16:07 +0000 (+0100) Subject: skip to first blank in grid X-Git-Url: https://git.sommitrealweird.co.uk/curses-crossword.git/commitdiff_plain/93abf50bf3f0f32684dbd9cc73179a8b1220b69d?ds=inline;hp=63cdf0aacdd38a6a5d14f8e142288e75a6fad0d1 skip to first blank in grid --- diff --git a/curses-crossword.py b/curses-crossword.py index d11568a..a396105 100644 --- a/curses-crossword.py +++ b/curses-crossword.py @@ -27,7 +27,7 @@ except: for number in range(0,10): superscript_numbers[str(number)] = str(number) -crossworddata = codecs.open("g2-20090701.txt", "r", "utf-8").read() +crossworddata = codecs.open("crossword.output", "r", "utf-8").read() def parsecrossword(crossworddata): ingrid = False @@ -178,7 +178,12 @@ def crossword(stdscr, crossworddata): gridx = 0 gridy = 0 - stdscr.move(1,3) + while crossword["grid"][gridy][gridx] == "x": + curx += 4 + gridx += 1 + + stdscr.move(cury,curx) + while 1: c = stdscr.getch() if c == curses.ascii.ESC: