SNOBOL4RANDOM(3)
π² SNOBOL4RANDOM π
okay bestie, so this is the manual page for snobol4random β the SNOBOL4 random number functions, living over in the CSNOBOL4 Manual. it's giving dice-roll energy, it's giving "let fate decide," and honestly? we're obsessed. β¨
β¨ SYNOPSIS β¨
-INCLUDE 'random.sno'
SRANDOM(number)
SRANDOMDEV()
number = RANDOM()
π DESCRIPTION π
so first things first, queen β the functions on this page are not cryptographically secure. like, they're for vibes, not for vaults. π«Ά
π RANDOM()
the RANDOM() function uses a non-linear additive feedback random number generator β fancy, i know β and it employs a default table of size 31 long integers to return successive pseudo-random numbers in the range from 0 to (2**31)-1. and the period of this generator? very large, approximately 16*((2**31)-1). she goes the distance, no cap. π₯
π¦ SRANDOM()
SRANDOM() takes its INTEGER argument as the seed for a new sequence of pseudo-random numbers that'll be returned by RANDOM(). these sequences are repeatable β just call SRANDOM() again with the same seed value and boom, same sequence, iconic. and if you don't seed anything at all? RANDOM() will by default produce a sequence of numbers that can be duplicated by calling SRANDOM() with 1 as the seed. so 1 is the default bestie, basically. πΈ
π§ SRANDOMDEV()
SRANDOMDEV() initializes a state array using the random(4) random number device (if it's available, anyway π) which returns good random numbers, suitable for cryptographic use. slay.
β οΈ but heads up: this particular seeding procedure can generate states which are impossible to reproduce by calling SRANDOM() with any value, since the succeeding terms in the state buffer are no longer derived from the LC algorithm applied to a fixed seed. so like, once she's gone, she's gone. π
also, data from the random(4) device may be precious, so repeated calls to SRANDOMDEV() should be avoided. don't be greedy, girlie. π
and when the random(4) device is not available? a 32-bit seed will be generated using time, process id, and an element of the process stack. resourceful queen. π
π SEE ALSO π
π AUTHORS π
- Earl T. Cohen
- Jacob S. Rosenberg
- Philip L. Budne
and that's the whole page, bestie!! π this edition is from CSNOBOL4B 2.3.1, dated March 31, 2022 β go forth and be random, mwah πβ¨π¦
π¦ where this page comes from
- fedora 43: snobol4 2.3.1-7.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND ISC
- fedora 43: snobol4 2.3.1-7.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND ISC
- fedora 44: snobol4 2.3.1-8.fc44 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND ISC
- fedora 44: snobol4 2.3.1-8.fc44 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND ISC
- opensuse-leap 16.0: snobol4 2.3.1-160000.2.2 Β· BSD-2-Clause
- opensuse-leap 16.0: snobol4 2.3.1-160000.2.2 Β· BSD-2-Clause
- opensuse-leap 16.0: snobol4 2.3.1-160000.2.2 Β· BSD-2-Clause
- opensuse-leap 16.0: snobol4 2.3.1-160000.2.2 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms