29/11/2013, 16:24
Merci d'utiliser les balises TCL et CODE pour mettre en forme ton post.
Ce petit script fonctionne:
Ce petit script fonctionne:
tcl
set l1 { "abc1" "abc2" "abc3" }
set l2 { "def1" "def2" }
set l3 { "ghi1" "ghi2" "ghi3" }
proc combination {head args} {
if {[llength $args]==0} { return $head }
set tail [eval combination $args]
foreach a $head {
foreach b $tail {
lappend out [concat $a $b]
}
}
lappend out
return $out
}
putlog [combination $l1 $l2 $l3]