cmdr
Artifact Content
Not logged in

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]
exit