a challenge
I was watching Countdown on TV earlier, and thought the numbers game might make an amusing challenge to write a program to solve. For those of you that don't know the programme, the problem is this - you have 6 randomly chosen small numbers1, and a randomly chosen target number2. You must use the small number to make the target, or as close as possible, using only addition, subtraction, multiplication and division, with brackets as necessary. All stages must be integers.
I have no idea how to solve this, but I fancy having a go. Actually if you search the web lots of people have tried this before. And Java isn't necessarily the best language to do it in, but that's what people here are interested in. Anyone else want to play along?
1The 'small numbers' are chosen from a range of several of 1-10, plus a range consisting of 25, 50, 75, 100. Contestants usually take 5 from the first range and 1 from the second, but occasionally 4 from the first and 2 from the second.
2The target is a 3-digit number.
I have no idea how to solve this, but I fancy having a go. Actually if you search the web lots of people have tried this before. And Java isn't necessarily the best language to do it in, but that's what people here are interested in. Anyone else want to play along?
1The 'small numbers' are chosen from a range of several of 1-10, plus a range consisting of 25, 50, 75, 100. Contestants usually take 5 from the first range and 1 from the second, but occasionally 4 from the first and 2 from the second.
2The target is a 3-digit number.
