import curses
from curses import wrapper
import queue
import time
maze = [
['#','#','#','#','#','0','#','#','#'],
['#',' ',' ',' ',' ',' ',' ',' ','#'],
['#',' ','#','#',' ','#','#',' ','#'],
['#',' ','#',' ',' ',' ','#',' ','#'],
['#',' ', '#',' ','#',' ','#',' ','#'],
['#',' ', '#',' ','#',' ','#',' ','#'],
['#',' ','#',' ','#',' ','#','#','#'],
['#',' ',' ',' ',' ',' ',' ',' ','#'],
['#','#','#','#','#','#','#','X','#',]
]
def print_maize(maze,stdscr,path=[]):
blue = curses.color_pair(1)
red = curses.color_pair(2)
for i,row in enumerate(maze):
for j,value in enumerate(row):
stdscr.addstr(i,j,value)
def main(stdscr):
curses.init_pair(1,curses.COLOR_BLUE,curses.COLOR_BLACK)
blue_and_black = curses.color_pair(1)
stdscr.clear()
print_maize(maze,stdscr)
stdscr.refresh()
stdscr.getch()
wrapper(main)
error code
<pre> File "c:\Python\New python learning.py\new proj.py", line 24, in print_maize
stdscr.addstr(i,j,value)
_curses.error: addwstr() returned ERR
What I have tried:
trying to create a maze game but not getting the output at this stage ,
error code as mentioned above
I am not able to understand how to proceed ahead