Faulty Game

Don’t you guys think the game is faulty as we can enter different variations of code to win. For example-
In my code(File attached), I have given hints that I need three numbers which add up to 6 and multiply to give 0. The numbers which i would want the user to enter is my code 4 2 0. But the user can also win the game by entering numbers like 5 1 0, 3 3 0, 4 0 2. Is the game supposed to be like this? If yes then why do we declare our integers at all? Why can’t we just enter -
if (GuessSum == 6 && GuessProduct == 0)
which would give the same result.

I think the issue is in having a 0 in the solution space. This is because there are Y - 1 combinations of couples that sum to Y, and all of these will have product 0 when multiplied by 0. I think with a positive product it is guaranteed that the solution, if any, is unique, but I’m not going to look for a mathematical proof right now.

If you give only positive numbers (as the tutor did in the video) this issue will not occur. This said, you’re theoretically right that by checking sum and product you can give the same result as checking the three variables.

Privacy & Terms