Différences entre les versions de « EASEA defined functions »

De
Aller à la navigation Aller à la recherche
Ligne 5 : Ligne 5 :
 
=== Description ===
 
=== Description ===
  
Simulated the toss of a coin. There are two different definitions of the tossCoin function:
+
Simulates the toss of a coin. There are two different definitions of the tossCoin function:
 
#A simple toss of a coin.
 
#A simple toss of a coin.
 
#A biased toss of a coin.
 
#A biased toss of a coin.
Ligne 22 : Ligne 22 :
  
 
== Random ==
 
== Random ==
 +
 +
=== Description ===
 +
 +
Generates a random number. There are several definitions to the random function:
 +
#Random function with Min Max Boundary
 +
#Random function with Max Boundary only
 +
In the case of a Max boundary only, the Min boundary will be 0.
 +
 +
=== EASEA syntax ===
 +
int random( int Min, int Max)
 +
 +
int random( int Max)
 +
 +
float random( float Min, float Max)
 +
 +
double random( double Min, double Max)

Version du 15 juin 2011 à 16:30

Random Number Generators

TossCoin

Description

Simulates the toss of a coin. There are two different definitions of the tossCoin function:

  1. A simple toss of a coin.
  2. A biased toss of a coin.

EASEA syntax

bool tossCoin()                // SImple tosscoin
bool tossCoin(float bias)  // Biased tossCoin

Example

if( tossCoin(0.1)){
    ...
}

Random

Description

Generates a random number. There are several definitions to the random function:

  1. Random function with Min Max Boundary
  2. Random function with Max Boundary only

In the case of a Max boundary only, the Min boundary will be 0.

EASEA syntax

int random( int Min, int Max)
int random( int Max)
float random( float Min, float Max)
double random( double Min, double Max)