Jump to content

Sort numbers lexicographically: Difference between revisions

Tcl: better iota
(Add Tcl)
(Tcl: better iota)
Line 1,194:
=={{header|Tcl}}==
<lang tcl>proc iota {num {start 0} {step 1}} {
set res {}
for { set iend 0; set n[+ $start} {[* $i <step $num} {incr i; incr n $step} {]]
for {set n $start} {$n != $end} {incr n $step} {
lappend res $n
}
}
return $res
}
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.