Humble numbers: Difference between revisions
→{{header|Wren}}: Tidy
(Added Easylang) |
(→{{header|Wren}}: Tidy) |
||
(One intermediate revision by one other user not shown) | |||
Line 2,379:
.
print ""
print ""
for i to 9
Line 2,385 ⟶ 2,384:
.
</syntaxhighlight>
{{out}}
<pre>
1 2 3 4 5 6 7 8 9 10 12 14 15 16 18 20 21 24 25 27 28 30 32 35 36 40 42 45 48 49 50 54 56 60 63 64 70 72 75 80 81 84 90 96 98 100 105 108 112 120
9 with 1 digits
36 with 2 digits
95 with 3 digits
197 with 4 digits
356 with 5 digits
579 with 6 digits
882 with 7 digits
1272 with 8 digits
1767 with 9 digits
</pre>
=={{header|Elm}}==
Line 6,819 ⟶ 6,832:
{{libheader|Wren-math}}
{{libheader|Wren-sort}}
To avoid resorting to Wren-long or Wren-big, we limit this to 16 digit integers which is the maximum Wren can handle 'natively'.
<syntaxhighlight lang="
import "./math" for
import "./sort" for Find
var humble = Fn.new { |n|
Line 6,862 ⟶ 6,875:
System.print(h[0..49])
var f = Find.all(h,
var maxUsed = f[0] ? f[2].min + 1 : f[2].min
var maxDigits = 16 //
var counts = List.filled(maxDigits + 1, 0)
var digits = 1
|