On Fri, 31 May 1996, Christopher Nicodemus wrote: > >rand_prog 90~ > if rand(50) > say Hey $r, do you know what 'you are standing' means? > endif > ~ > | > The newbie never says Hey $r, do you know what 'you are standing' means? > but when I remove the if rand(50) he says it every time. > why doesn't he say it with the if rand(50) ? Actually the program is working fine. Basically think of it this way. The rand_prog checks if a random number is < 90, if it is then it does what comes next. Then you have the 'if rand(50)' which checks if a new random number is < 50. It's just chance that it's not showing the message because of the double random check. If it's < 90, then it rols again, then it does the if -- rolls a new random number, if it's < 50 then it shows the message. Isn't that, though, a very poor implementation? It's repeative, and what does the $r code do?
This archive was generated by hypermail 2b30 : 12/18/00 PST