The program consists of three classes plus the Program class where the logic related to user interaction takes place.
The most important class is the GeneratorRovnic class, which takes care of generating a random equation. That's the part I'm happy with. That I finally put it together. At the same time, I'm aware of the shortcomings. I guess the main one is that the random equation, it's not actually random at all. And most importantly, the code doesn't generate all the theoretical possibilities. But still, it's a perfectly adequate scope for the average person. Well, and a genius is probably bored with normal Nerdle.
The Rovnice class represents the equation itself. Probably the most important here are the methods used to determine equality. This is because the principle of the Generator is that it generates the result and the first number in the equation. The methods for determining equality then output true or false, depending on whether the left side is equal to the right side according to the given parameters. If not, the Generator adjusts the generated numbers so that both sides are equal. A simple but as you can see functional principle.
The last class VykreslovacRovnic is mainly responsible for checking the user input and comparing it with the generated equation. As in the original game, each character in my program is colored separately, in one of three colors. If a character does not appear in the equation at all, it is colored gray, if it occurs in another position it is colored red, and if it occurs in that exact position it is colored green. The user is prompted for a new input if the equation contains an invalid character. It is easier if I list the allowed characters. These are digits from 0 to 9 plus the operators +, -, *, / and =. Anything else is an invalid character. The important thing, of course, is equality. If the left side is not equal to the right, again the user is prompted for new input.
The logic itself in the Program class contains, among other things, a collection for storing the equation as text. There is also a collection with allowed characters and instances of all other classes. All user interaction is stored in the main while loop, which is controlled via a logical variable. Again, nothing complicated really.
So much for a quick description. If you look at the code, you will notice some not so small commented parts. These were created during the actual creation of the program. When I've written larger pieces of code, I've often come to a more efficient solution. Previous parts that cost me some effort I was subsequently sorry to delete. That's why I left them commented out. These parts may not capture all the possibilities that mathematics theoretically offers us, so be aware of that if you want to use them. All other parts of the code should be fully tested and any exceptions handled.