Menu: Difference between revisions

Content added Content deleted
(→‎Tcl: Added implementation)
(→‎{{header|Tcl}}: increase Tcl-ishness)
Line 102: Line 102:
set numWidth [string length $nc]
set numWidth [string length $nc]
while true {
while true {
for {set i 0} {$i<$nc} {} {
set i 0
set s [lindex $choices $i]
foreach s $choices {
incr i
puts [format " %-*d: %s" $numWidth [incr i] $s]
puts [format " %-*d: %s" $numWidth $i $s]
}
}
puts -nonewline "$prompt: "
puts -nonewline "$prompt: "