Search code examples
python-3.xcursesminesweeper

Make Cells in Python Curses


I am trying to make a Minesweeper game in python's curses and I wanted a way to distinguish every pixel but still having every pixel blank. Is there some method or function in curses that you can use that works like the border() method but instead add lines between every pixel? I know that I can manually add "|" and "-" e.g. to make a grid of my own. But doing so almost doubles the size of the window and since the pixels aren't perfect squares the grid would look very bad.


Solution

  • curses works for terminals that use characters, organized in rows and columns. Those do not (in general) have graphical features allowing you to draw between the characters.

    Rather than drawing lines, an alternative approach would be to use each cell's background color to provide additional clarity.