Jump to content

Prime words: Difference between revisions

Line 516:
A suitable implementation of `is_prime` is given at
[[Erd%C5%91s-primes#jq]] and is therefore not repeated here.
<lang jq>def is_prime_word: all(explode[]; is_prime);
 
The task description suggests that perhaps the appropriate
definition of `is_prime_word` should focus on the alphabetic characters,
perhaps along the lines of:
<lang jq>def is_prime_word: all(gsub("[^A-Za-z]";"") | explode[]; is_prime);
</lang>
All such variations are as easy to accommodate as to envision, but for unixdict.txt the following suffices:
<lang jq>def is_prime_word: all(explode[]; is_prime);</lang>
<lang jq>
inputs | select(is_prime_word)</lang>
{{out}}
Line 559 ⟶ 566:
q
</pre>
 
 
=={{header|Julia}}==
2,469

edits

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