in the section TripleX, there is a part that I am sooo curious about.
From Line 29 to Line 31, I added the cout for all the answer because I want to test the game’s winning part by knowing the answer immediately and type the answers to test the game.
But the problem is… when I play it, it doesn’t print them out, instead, the game runs normally but the “Cheat” doesn’t work.
I really wonder why, as the AnsSum and the AnsProduct can be printed out perfectly fine, why the “Cheat” cannot be printed out? TripleX cout question.zip (1.0 KB)
double is a floating point type which is used to express any real number. Since we’re only interested in whole numbers this isn’t the correct type to be using. int should be used instead.
It’s good that you’re doing things on your own but perhaps this is the wrong way to go about it? It seems like you’re trying hard to memorize code rather than to understand how it works.
Instead of trying to recreate TripleX from memory. Try create something else entirely, like a number guesser. Ask the user to think of a number and then have the game come up with a number and ask the user if it’s higher, lower, or the correct number.
I suggested that because it doesn’t like you quite understand how everything works as you have multiple beginner level errors in the code you posted as mentioned above.
Do you understand my explanations of such and how to solve them?