4 ms·
> Even the "grid" could be an optional setting, placing a slight emphasis on user skill in being able to visualize the grid on their own. As a starting point (
by shagie 2y ago
> Even the "grid" could be an optional setting, placing a slight emphasis on user skill in being able to visualize the grid on their own.
As a starting point (and only a few because this gets long and tedious to show) - it uses tput ( https://man7.org/linux/man-pages/man1/tput.1p.html https://man7.org/linux/man-pages/man1/tput.1p.html https://www.gnu.org/software/termutils/manual/termutils-2.0/html_chapter/tput_1.html https://www.gnu.org/software/termutils/manual/termutils-2.0/... )
#!/bin/bash
echo ' A B C D E F G H'
echo -n '1 '
tput mr
echo -n 'r'
tput me
echo -n ' n '
tput mr
echo -n 'b'
tput me
echo
- rosmax_1337 2y agoI'm going to assume this produces a grid. Once again, we are reinventing a graphical user interface. If we wanted all this, why wouldn't we open firefox and go to chess.com or lichess.org. Or even something that runs natively on your computer, perhaps even producing lavish and beautiful 2d or 3d rendering of the game.