ftp.nice.ch/pub/next/games/board/Risk.0.97.s.tar.gz#/RiskSource0.97/Risk/Random1.1.source/RandomSummary.rtf

This is RandomSummary.rtf in view mode; [Download] [Up]

Version 1.1: Written by Gregor N. Purdy. Copyright ©1991, 1992 Contemporary Design Studios. All rights reserved.

Random 

Random : Object



Creating and Freeing Instances

+ alloc	Allocates and returns a new instance
- free	Frees an instance



Getting The Class Version

+ version	Returns the version of the class



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



Getting and Setting Seeds

- 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



Gaussian Parameters

- (double)gOrigin	Returns the origin of Gaussian configuration
- (double)gScale	Returns the scale of Gaussian configuration
- setGOrigin:(double)anOrigin	Sets seeds to those given
- setGScale:(double)aScale	Stuffs seeds into int variables given



Getting Random Numbers

- (BOOL)bool	Returns either YES or NO
- (double)gaussian	Returns a Gaussian variable
- (double)percent	Returns a double from 0.0 to 1.0
- (int)rand	Returns an int from 0 to 32767
- (double)randFunc:(ddfunc)func	Returns an int from 0 to max
- (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



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.