Primes with digits in nondecreasing order: Difference between revisions
Primes with digits in nondecreasing order (view source)
Revision as of 16:28, 28 January 2024
, 4 months ago→{{header|Wren}}: Minor tidy
No edit summary |
m (→{{header|Wren}}: Minor tidy) |
||
Line 1,632:
=={{header|Wren}}==
{{libheader|Wren-math}}
{{libheader|Wren-fmt}}
<syntaxhighlight lang="ecmascript">import "./math" for Int
import "./
var nonDescending = Fn.new { |p|
Line 1,654 ⟶ 1,652:
for (p in primes) if (nonDescending.call(p)) nonDesc.add(p)
System.print("Primes below 1,000 with digits in non-decreasing order:")
Fmt.tprint("$3d", nonDesc, 10)
System.print("\n%(nonDesc.count) such primes found.")</syntaxhighlight>
|