This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.
Help for those learning Tcl or writing their own scripts.
-
Torrevado
- Op
- Posts: 101
- Joined: Wed Aug 02, 2006 6:29 pm
Post
by Torrevado »
Hello,
I'd like to know how to get two different random values. Value 1 + Value 2 *must* be = 100
I tried
Code: Select all
set value1 [rand 100]
set value2 [rand 100]
Obviously doing addition of both values, the result can be less than 100 or upto 200.
Last edited by
Torrevado on Sun Aug 22, 2010 1:46 pm, edited 1 time in total.
-
willyw
- Revered One
- Posts: 1205
- Joined: Thu Jan 15, 2009 12:55 am
Post
by willyw »
Torrevado wrote:Hello,
I'd like to know how to get two different random values. Value 1 + Value 2 *must* be = 100
I tried
Code: Select all
set value1 [rand 100]
set value2 [rand 100]
Obviously doing addition of both values, the result can be less than 100 or upto 200.
How about :
-
Torrevado
- Op
- Posts: 101
- Joined: Wed Aug 02, 2006 6:29 pm
Post
by Torrevado »
Yeah, that is.
Thank you very much