I need help creating a C++ code that can guess a 4 digit number
Basically, as the title says, I try to create a code in C++ that can guess a 4 digit number based on input. Everytime it gets the right digit in the right position, the input should be 1, 2, 3 respectively 4 for the correct guessing of the number. Let’s say the number is 7130 and the number provided by the code is 7300, the input to help it guess should be the number 2, because 7 and 0 are in the right positions. I’ve thought about using a lot of if’s for inputs like 2 and 3, then rearranging/changing numbers until it could figure out which numbers are in the correct positions. Should it be recursive? I thought about using Divide Et Impera too, but not sure how to implement it.