Want to get involved? We're always looking for ideas and content for Weekly Challenges.
SUBMIT YOUR IDEAHi,
when I was creating my solution, I assumed that ball cannot go outside of this Plinko Tree.
That's why results I received are different then the official solution.
Inter macro (iterative):
I messed up the logic at the start of my workflow so a macro wasn't possible without going back and changing it. What was possible however, and definitely faster in this one off instance, was copying and pasting with very minor tweaks. An arguable Alteryx sin but I don't take it back. The general logic is included in the pic.
*Sigh* The provided solution does not account for the ball hitting the wall. I got the same target value, 0.109375, which is the result for an unbound Pascal's Triangle starting at 0.25 on layer 3, so looks right. All of the other values are different, because of wall bounces, so I think Alteryx have been very sly here. If Alteryx had asked us to find a different end point, the provided solution would have had to be more sophisticated.
Approach; I built a macro that added a layer of pegs and worked out the odds from the parent row above. I added a wall algorithm, and made the wall values movable so you could work out different odds for different width boards and different entry points relative to the walls. I wrapped the iterative macro in an outer macro to put an interface on and add columns that the iterative macro expects. The ball entry point is X coordinate zero, and walls are defined by how many possible pegs away from zero they are, to allow for an asymmetric ball entry position.
This was a great challenge, really hard if you want it to be...
X ORDER COORD
-7 -6 -5 -4 -3 -2 -1 0 1 2 3
LAYER
0 ||o o o o X o o||
1 || o o o o o ||
2 ||o o o o o o||
3 || o o o o o ||
4 ||o o o o o o||
5 || o o o o o ||
6 ||o o o o o o||
7 || o o o o o ||
8 ||o ? o Y o ? o ? o ? o||
Wall Values 7 3