1. pick a random number
2. assign a certain value to a variable according to the number
This is what I came up with:
Code: Select all
set foo [random 9]
if {$foo >= 0 && $foo <= 2} { set bar "something" }
if {$foo >= 3 && $foo <= 6} { set bar "something else" }
if {$foo >= 7 && $foo <= 9} { set bar "something completely different" }
I have thought about alternative ways but since I'm quite new to tcl it just makes my head hurt

I also searched the forums but couldn't find anything helpful.
Any help will be appreciated.
[EDIT: typos and stuff]