Countdown: Difference between revisions
Content added Content deleted
(J draft) |
m (→{{header|J}}: discard duplicate solutions) |
||
Line 44: | Line 44: | ||
expr=: {{ (Pa A),(;u`''),Pa B['A B'=.y }} |
expr=: {{ (Pa A),(;u`''),Pa B['A B'=.y }} |
||
arith=: [:; <@(+Va, -Va, *Va, %Va,(-Va, %Va)@|.)"1 |
arith=: [:; <@(+Va, -Va, *Va, %Va,(-Va, %Va)@|.)"1 |
||
all=: {{ A#~x=".@>A=.,arith^:5 ":each y}} |
all=: {{ A#~x=".@>A=.~.,arith^:5 ":each y}} |
||
task=: {{ |
task=: {{ |
||
Line 55: | Line 55: | ||
Examples: |
Examples: |
||
<syntaxhighlight lang=J> task'' |
<syntaxhighlight lang=J> task'' |
||
terms: |
terms: 2 3 3 6 9 50 |
||
target: |
target: 476 |
||
#solutions: |
#solutions: 77 |
||
for example: ( |
for example: (9*(3+50))-(6-(2+3)) |
||
task'' |
task'' |
||
terms: 1 |
terms: 1 4 6 7 8 9 |
||
target: |
target: 657 |
||
#solutions: |
#solutions: 75 |
||
for example: |
for example: 9*(8+((1+4)*(6+7))) |
||
task'' |
|||
terms: 4 7 8 9 10 10 |
|||
target: 300 |
|||
#solutions: 495 |
|||
for example: (10+(9*10))*((4+7)-8)</syntaxhighlight> |
|||
=={{header|Phix}}== |
=={{header|Phix}}== |