Fairly simple game - one that I like to play with my kids.
You are given 5 numbers between 1 and 9. Using just +, -, x, / and () use the first 4 to make the 5th. You have to use all 4, and can only use them once.
Example:
[ 3 9 8 3 | 8 ]
( 9 / ( 3 x 3 ) ) x 8 = 8
Probably best to spoiler your answers. Apparently this is how to do that:
I generated these randomly. Some will probably be trivially easy. Hopefully some will provide a bit of a challenge. Some may even be impossible.
1: [ 2 3 5 6 | 8 ]
2: [ 3 3 2 6 | 8 ]
3: [ 7 3 2 7 | 9 ]
4: [ 5 5 4 4 | 4 ]
5: [ 4 8 4 8 | 2 ]
6: [ 8 8 9 4 | 1 ]
7: [ 6 9 3 5 | 6 ]
8: [ 4 8 8 2 | 5 ]
9: [ 3 8 6 1 | 2 ]
10: [ 3 7 9 7 | 8 ]
Interesting. I feel like I want to look for an algorithm or patterns.
There are a few go-to “tricks” that I usually start with. Often making a 0 or a 1 is very helpful.
I’ve found that there aren’t all that many that are impossible. Obviously something like [ 1 1 1 1 | 6 ] isn’t going to work, but most of them do.
I usually play this with my kids using playing cards (A through 9).
Now I want to create a program to play this here.
I’ll start posting my solutions:
1: [ 2 3 5 6 | 8 ]
Solution #1
( ( 6 / 3 ) x 5 ) - 2 = 8
5: [ 4 8 4 8 | 2 ]
Solution #5
(4 / 4 ) + ( 8 / 8 ) = 2
I’ll do some more a bit later.
8: [ 4 8 8 2 | 5 ]
[details="Solution #8]
4 + 2 - ( 8 / 8 ) = 5
[/details]
And the winner is…
let the suspense build....
hey, you can nest spoilers!
Doesn't look quite as cool as the AO though
soyleche!
I know, everyone is really surprised.
A more complicated one. I didn’t figure out the solution - I had to be shown:
[ 1 1 5 8 | 10 ]