Jump to content

SEND + MORE = MONEY: Difference between revisions

Line 371:
{{works with|jq}}
'''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 of the def:
<syntaxhighlight lang=jq>
def send_more_money:
Line 387 ⟶ 388:
| 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))
| [{$s,$e,$n,$d,$m,$o,$r,$e,$m,$o,$n,$e,$y]} );
 
send_more_money
Line 395 ⟶ 396:
{"s":9,"e":5,"n":6,"d":7,"m":1,"o":0,"r":8,"y":2}
</pre>
 
=={{header|Julia}}==
A hoary old task, solved with pencil before electricity was a thing.
2,471

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.