SEND + MORE = MONEY: Difference between revisions
Content added Content deleted
Line 371: | Line 371: | ||
{{works with|jq}} |
{{works with|jq}} |
||
'''Works with gojq, the Go implementation of jq, and with fq''' |
'''Works with gojq, the Go implementation of jq, and with fq''' |
||
Straight out of the [https://en.wikipedia.org/wiki/Jq_(programming_language) wikipedia] page, except for {} instead of [] in the last line: |
Straight out of the [https://en.wikipedia.org/wiki/Jq_(programming_language) wikipedia] page, except for {} instead of [] in the last line of the def: |
||
<syntaxhighlight lang=jq> |
<syntaxhighlight lang=jq> |
||
def send_more_money: |
def send_more_money: |
||
Line 387: | Line 388: | ||
| choose(2;9;[$s,$e,$n,$d,$r]) as $y |
| choose(2;9;[$s,$e,$n,$d,$r]) as $y |
||
| select(num($s;$e;$n;$d) + num($m;$o;$r;$e) == num($m;$o;$n;$e;$y)) |
| select(num($s;$e;$n;$d) + num($m;$o;$r;$e) == num($m;$o;$n;$e;$y)) |
||
| |
| {$s,$e,$n,$d,$m,$o,$r,$e,$m,$o,$n,$e,$y} ); |
||
send_more_money |
send_more_money |
||
Line 395: | Line 396: | ||
{"s":9,"e":5,"n":6,"d":7,"m":1,"o":0,"r":8,"y":2} |
{"s":9,"e":5,"n":6,"d":7,"m":1,"o":0,"r":8,"y":2} |
||
</pre> |
</pre> |
||
=={{header|Julia}}== |
=={{header|Julia}}== |
||
A hoary old task, solved with pencil before electricity was a thing. |
A hoary old task, solved with pencil before electricity was a thing. |