This is RandomSummary.rtf in view mode; [Download] [Up]
Version 1.0 Copyright ©1991 by Gregor N. Purdy. Rights as per GNU Public License, Version 1 or later. Random Random : Object Creating and Freeing Instances + alloc Allocates and returns a new instance - free Frees an instance Initializing a New Instance - init Initializes a new instance with seeds from system time - initSeeds:(int)s1 :(int)s2 :(int)s3 Initializes a new instance with given seeds Seed Operations - newSeeds Gets new seeds from system time - setSeeds:(int)s1 :(int)s2 :(int)s3 Sets seeds to those given - getSeeds:(int *)s1 :(int *)s2 :(int *)s3 Stuffs seeds into int variables given Getting Random Numbers - (int)rand Returns an int from 0 to 32767 - (int)randMax:(int)max Returns an int from 0 to max - (int)randMin:(int)min max:(int)max Returns an int from min to max - (float)percent Returns a float from 0.0 to 1.0 Rolling Dice - (int)rollDie:(int)numSides Returns an int from 1 to numSides - (int)roll:(int)numRolls die:(int)numSides Returns an int from numRolls to numRolls * numSides - (int)rollBest:(int)numWanted Returns the best numWanted of numRolls rolls of:(int)numRolls die:(int)numSides Archiving - read:(NXTypedStream *)stream Reads a Random from stream - write:(NXTypedStream *)stream Writes a Random to stream
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.