|
Tarquin Newbie
Joined: 15 Jan 2004 Posts: 3
|
Posted: Thu Jan 15, 2004 7:27 am
Help with adding to variables |
Probably seems strange but what i want to do is create a set number of random numbers, which i can do like this
#loo XXX {#E %random(1,49)}
where x is the set number of times.
The #e is just there so that i can see the numbers as they come up, doesn't really have to be there, I can always just show the Variables when it is done.
Now i want to, each time a new number is generated add one to a variable. where the variables are n1,n2,n3.....n49. So if i run it 50 times I will have say n1=7 n2=12......and so on.
I am sure this can be easily done, but am very new to any kind of programing and I just can't come up with a solution. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Thu Jan 15, 2004 2:43 pm |
#LOOP XXX {#VAR n%i {%random(1,49)}}
|
|
|
|
Tarquin Newbie
Joined: 15 Jan 2004 Posts: 3
|
Posted: Thu Jan 15, 2004 6:38 pm |
Well that helps a little bit, but i only want the variables to be n1-n49 where each variable is = to the number. n1 if for 1 n2 is for 2...n49 is for 49. then for each time a one of the numbers comes up 1-49 i want to add one to that variable. What i want is to get random numbers and then have a list of how many times each of those numbers came up.
The way that worked. the variables were set to whatever time thru the loop it was and then that had a random number between 1-49. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Jan 15, 2004 7:28 pm |
#LOOP 100 {#ADD n%random( 1, 49) 1}
|
|
|
|
Tarquin Newbie
Joined: 15 Jan 2004 Posts: 3
|
Posted: Fri Jan 16, 2004 5:54 am |
That's the Ticket. Thanks alot.
|
|
|
|
|
|