Jump to content

Primes with digits in nondecreasing order: Difference between revisions

m
No edit summary
m (→‎{{header|Wren}}: Minor tidy)
Line 1,632:
=={{header|Wren}}==
{{libheader|Wren-math}}
{{libheader|Wren-seq}}
{{libheader|Wren-fmt}}
<syntaxhighlight lang="ecmascript">import "./math" for Int
import "./seqfmt" for LstFmt
import "/fmt" for Fmt
 
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)
for (chunk in Lst.chunks(nonDesc, 10)) Fmt.print("$3d", chunk)
System.print("\n%(nonDesc.count) such primes found.")</syntaxhighlight>
 
9,485

edits

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