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:
+
Simulated 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 11 : Ligne 11 :
 
=== EASEA syntax ===
 
=== EASEA syntax ===
  
  boolean tossCoin()                // SImple tosscoin
+
  bool tossCoin()                // SImple tosscoin
  
  boolean tossCoin(float bias)  // Biased tossCoin
+
  bool tossCoin(float bias)  // Biased tossCoin
  
 
=== Example ===
 
=== Example ===
Ligne 20 : Ligne 20 :
 
     ...
 
     ...
 
  }
 
  }
 +
 +
== Random ==

Version du 15 juin 2011 à 16:14

Random Number Generators

TossCoin

Description

Simulated 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