Specifications

BASIC Stamp II
Parallax, Inc. • BASIC Stamp Programming Manual 1.8 • Page 275
2
divisible by another if the remainder from division, determined by the
// operator, is 0.) If a number is divisible by 3, then it is printed, other-
wise, the program generates another random number. The program
counts how many numbers it prints, and quits when this number
reaches 10.
sample var word ' Random number to be tested.
samps var nib ' Number of samples taken.
mul3:
random sample ' Put a random number into sample.
IF NOT sample//3 = 0 THEN mul3 ' Not multiple of 3? Try again.
debug dec sample," is divisible by 3.",cr ' Print message.
samps = samps + 1 ' Count multiples of 3.
IF samps = 10 THEN done ' Quit with 10 samples.
goto mul3
done:
debug cr,"All done."
stop