cmdr
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 48394c38c819c5a540c33646fdaadcfce3228197:


#!/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 choose {Which fruit} $fruit $rand]
exit