Anonymous user
Digital root/Multiplicative digital root: Difference between revisions
Digital root/Multiplicative digital root (view source)
Revision as of 15:49, 27 April 2014
, 10 years ago→{{header|Tcl}}: more informative variable names
(→Tcl: Added implementation) |
m (→{{header|Tcl}}: more informative variable names) |
||
Line 343:
}
puts ""
# The longEnough variable counts how many roots have at least 5 values accumulated for them
for {set i [set
if {[llength [lappend accum($root) $i]] == 5} {incr longEnough}
}
puts "MDR: \[n\u2080\u2026n\u2084\]"
puts [regsub -all . "MDR: \[n\u2080\u2026n\u2084\]" -]
for {set i 0} {$i < 10} {incr i} {
puts [format "%3d: (%s)" $i [join [lrange $
}</lang>
{{out}}
|