I found how to work things out! I started using  instead of system(), and it worked. Now I have one randomly generated task with the result in one variable and the task itself in another. And you can choose the tasks difficulty
I'm god.
Merge branch 'master' of https://github.com/hidroo/HexBin