I am trying to learn more about the design of algorithms, and I set myself the task of creating a simple game that presents users with an array of numbers, a target number and a series of operators (plus, minus, multiply, divide, possibly the square root, and so on). I need to decide if this target number can be made using the available numbers in the array.
I am a little puzzled where to start. Different operators may be available in different rounds of the game, such as +, -, *, and / , + and - , only + and * or all but + , etc.
Am I right in saying that I really need a separate algorithm for each combination of operators (be that as it may, 20 or something else)? And if so, then I will need to go through each number in the grid, executing each available operator from each other in the array? This seems too confusing, but I'm not quite sure what other options exist. This option also does not correspond to a specific path through several operations (for example, if I wanted to do 7 , I can do 12 + 5 - 10 if they were the only numbers available to me in the array).
Can someone give me some guidance on where to start this problem?
Luke source share