Artifact Content
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Artifact e6c94c3edb817e6982f53bc26d4da4374901bd20:

#!/usr/bin/env tclsh
# -*- tcl -*-
package require Tcl 8.5
package require cmdr::ask

lappend fruit apple
lappend fruit cherry
lappend fruit plum
lappend fruit peach
lappend fruit banana
lappend fruit pear

set rand [lindex $fruit [expr {int(0.1+(rand()*([llength $fruit])))}]]

puts [cmdr ask menu {Choose your meal} {Which fruit} $fruit $rand]