Sudoku is a game played on a 9x9 grid where every single square is filled with a number from 1 to 9 unique to its row, column, and 3x3 subgrid. This program is a sudoku app that allows a user to generate sudoku boards, solve given boards instantly, and play randomly generated or given sudoku boards.
Certain flags should not be able to be written at the same time. For example:
--difficulty should only be allowed to be called when --generate or --play are called
--generate shouldn't be callable when --play is called, and vice versa
--help and --version shouldn't allow any other flags to work together
Maybe allowing --generate and --play alongside --solve would be okay? I'm not totally sure about this idea though.
I think the best way of dealing with flags is creating a priority list, and letting one thing take priority over another (i.e. help > version > play > generate, etc), while of course ensuring there's no mutually exclusive calls.
As I was reading through another github repository, I saw something with a .1 extension. Come to find out, this was the manual page, and it's how you can actually give Linux programs a manual in the man program. This is really cool, and I always wondered how to do it.
It made me realize, though: this entire program is just in a folder. I think it'd be a cool learning experience to make this program downloadable through sudo (or any other package manager, but I'm just familiar with sudo). I think this would be something really cool to try once I've got my program more in line with modern Linux-type programs.
When focused on a square, pressing a character other than N, the arrow keys, or a number causes the minimap to freak out and place random numbers on the minimap.
While this doesn't affect the board itself, it's still strange and shouldn't be happening.
I think it'd make more sense to have generate naturally print the generated board to the terminal, and only output it to a file when a specific flag would be called alongside it (say, for example, "-o " ?)
Possibly removing the generate required argument for the flag may make more sense altogether, though I'm not sure what I think I should do about it yet.
As of v1.1.0, the main menu only takes commands by their initial (i.e. to generate only takes "G", and to get help only takes "H"). Allowing users to print the full word would be nice.
So this whole time I've been writing this code using WSL. That's cool and all, and I've learned that Linux is vastly superior to Windows when it comes to programming, but the issue is that I still want this program to be functional on Windows.
This sounds like a huge project in and of itself. I'm not going to prioritize Windows compatibility right now because the project isn't in a state where I'd really want to share it with people yet, but I think I should definitely start figuring out how to write C++ for Windows.
Some programs, such as Vim, allow one to write a .rc file which saves customization very easily. I think this is super cool and having the ability to customize color or automatically set difficulty would be so cool.
When you call Q on the command, there's a pause to just show the banner one more time before it stops running the program entirely. This pause is super slow and should be shortened.
Right now, when you run the program, it runs the linux command "clear", and clears the entire terminal. This wouldn't be a problem, but once the program is done, the terminal has still been cleared and history is gone.
I look at programs like sl to try to figure out how they temporarily cleared the screen, but it looks like they used the curses library to do what I'm looking to do. I've always been one to shy away from libraries (probably just because I'm hard headed and would rather understand the code than just accept that it works and move on), but I may start using curses to make my life a lot easier in general, since I am basiccally creating a terminal-based GUI.
Okay, so as painful as the process of mathing out each square and it's colors was, there's something that just feels good about being able to use the arrow keys to move. I think maybe making all menus use arrow keys would be a really cool feature, though I'm unsure of whether or not that'd be something people would necessarily want, since it's definitely slower.
Maybe keeping the current options, but adding arrow key functionality could be the way to go?
During version 1.3.1, when showing the project to a friend, I discovered that this project only compiles on Linux, and there are strange compilation errors regarding the enumerable type SquareStatus.
My suspicion is that it's an issue with how the .h files are being handled, though I'm unsure of why.