Skip to content

Instantly share code, notes, and snippets.

@raws
Created June 18, 2009 23:06
Show Gist options
  • Save raws/132271 to your computer and use it in GitHub Desktop.
Save raws/132271 to your computer and use it in GitHub Desktop.
proc checkbox {args} {
set choice [expr {int(rand()*[llength $args])}];
for {set i 0} {$i < [llength $args]} {incr i} {
if {$i == $choice} {
lset args $i [format {[x] %s} [lindex $args $i]]
} else {
lset args $i [format {[ ] %s} [lindex $args $i]]
}
};
puts [join $args { }];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment