Is it possible to set a random number (random) in some range, for example, from 100 to 200. And not from scratch ...
random(201) // 0 - 200 Is it possible to set a random number (random) in some range, for example, from 100 to 200. And not from scratch ...
random(201) // 0 - 200 random(100)+100 random(101)+100 . - KromsterThe Math module has a special function:
function RandomRange(const RangeFrom, RangeTo: Integer): Integer; Delphi function
RandomRangegenerates an arbitrary integer (integer) within the rangeRangeFromandRangeTo.It provides a more convenient version of the
Randomfunction of theSystemmodule.Both use a pseudo-random number sequence of 2 ^ 32 values. Each time you run your program, the generated values will be the same, unless you install the generator in an arbitrary part of the sequence, using the
RandomizeorRandSeed.
Source: https://ru.stackoverflow.com/questions/71095/
All Articles