Solve the no connection puzzle: Difference between revisions

Content added Content deleted
Line 563: Line 563:
6 5 2 8 1 7 4 3</lang>
6 5 2 8 1 7 4 3</lang>


Since there are more than one arrangements of pegs which satisfy the task constraints, and since the task calls for one solution, we will need to pick one of them. We can use the "first" function to satisfy this important constraint.
Since there's more than one arrangement where the pegs satisfy the task constraints, and since the task calls for one solution, we will need to pick one of them. We can use the "first" function to satisfy this important constraint.


<lang J> disp {. (#~ 1<attempt"1) pegs
<lang J> disp {. (#~ 1<attempt"1) pegs