09 Jul 10, 04:34PM
The rolldie command:
rnd 2 will produce either 0, 1, or 2. The context "if (rnd 2)" makes it interpreted as either 1 or 0. When a number greater than 1 is put to a binary test, it is called "1". "if (rnd 2)" is generating such a binary test, but producing 3 possible numbers.
Whatever is picked as $arg1 will be selected 66% of the time, while the second argument will only be picked 33% of the time. Test it!
rnd 2 will produce either 0, 1, or 2. The context "if (rnd 2)" makes it interpreted as either 1 or 0. When a number greater than 1 is put to a binary test, it is called "1". "if (rnd 2)" is generating such a binary test, but producing 3 possible numbers.
Whatever is picked as $arg1 will be selected 66% of the time, while the second argument will only be picked 33% of the time. Test it!