Still research with permutation thing if this kind of thing could be applicable in your case.
If that the case use Buildbox as your game engine. Try to reach it's community to help you along the way.
From my understanding (example1) duplicate has maximum number allowed based on first array as reference. So the third "b" in second array no longer valid since previous 2 "b" already occupied in correct order of existance thus return value '3'.
Old example but with give a good start how to animate a graph: dropbox.com/s/vx16gdzap0nt5bs/grafik_bar.capx
Develop games in your browser. Powerful, performant & highly capable.
I think I have made an example but forgot where do I put it. Anyway asssume that we want to fling object like Angry Birds. At least we need Touch object and Physics behavior on a sprite. Touch will determine aim direction while physics will do the rest.
Please pick this simple demo: https://www.dropbox.com/s/a1yzmyusayn2omi/fling_physics_impulse.capx?dl=0
Rarely using it but I'll reach you at Discord. Invitation sent.
Probably you need to change the direction to 4 directions. Also set angle to No rather than using every tick.
I can give a hand to your specific swing rope. It just old example demo-ing one of many possible way to hook rope. Really it took time to modify the example tailored to your expectation. Feel free to modify it or just ignore it.
I get immersion that analog jump is what you are after. If that the case followng platformer-proto should in your check list: dropbox.com/s/a5bzym3aex89j70/platform_slope.capx
Hope this example give you some insight: dropbox.com/s/rh30yc2lh0iciy3/hook_chain.capx
You may ask the person in this topic: construct.net/en/forum/construct-2/how-do-i-18/qix-game-68202
To create graph chart a series of value need to be presented as an input to set different elevation point
Use impulse to simulate a fling by set the amount and the angle. Specify how the fling should work in the game.
Finally, with visual approach "raycast' determine circle with 3 most outside points is possible: https://www.dropbox.com/s/2l1vyyyr94t3sti/Circle_3Points.capx?dl=0
Sort of trigonometri equation approach that involved tangent. I'll investigate to figure out. My current solution is not precise and not smooth (no trigonometri):
dropbox.com/s/9nhpn4zwohl9ymn/Circle_around_us.capx