Pascal's triangle/Puzzle: Difference between revisions

→‎{{header|Picat}}: Split into subsections
(→‎{{header|Picat}}: Split into subsections)
Line 2,230:
Below are three different approaches using constraint modelling (cp solver).
 
===Using lists to represent the triangle===
{{trans|Prolog}}
<lang Picat>import cp.
Line 2,271 ⟶ 2,272:
[x = 5,y = 13,z = 8]</pre>
 
===Calculating the positions===
Here is a contraintconstraint model which calculates the positions in the triangle that should be added together.
<lang Picat>import cp.
 
Line 2,324 ⟶ 2,326:
<pre>[x = 5,y = 13,z = 8]</pre>
 
And then a version with hard===Hard coded constraints:===
<lang Picat>import cp.
 
Line 2,361 ⟶ 2,363:
{{out}}
<pre>[x = 5,y = 13,z = 8]</pre>
 
 
=={{header|PicoLisp}}==
495

edits