Article Preview
Buy Now
COLUMN
Column
Issue: 14.4 (July/August 2016)
Author: Marc Zeedar
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: ription>No description av
Article Length (in bytes): 12,101
Starting Page Number: eN
Article Number: 14408
Resource File(s):
project-14408.zip Updated: 2016-07-04 14:35:28
Related Link(s): None
Excerpt of article text...
In last issue's
Beginner's Corner I wrote about obfuscation and in that I talked a little about randomization. It occurs to me that I've never written about randomization inxDev and that it's an important topic that is often tricky for beginners.In the old days, back when I started programming computers in high school, we only had the
rnd
command. It returns a random number between 0 and 1. Since most of the time you wanted a whole number—say, to represent the roll of a die in a game—you then had to multiply thernd
result and round up to produce a number in the range you wanted.
// Die roll using rnd. dim dieRoll as integer = round(rnd * 6)
...End of Excerpt. Please purchase the magazine to read the full article.