Différences entre les versions de « EASEA defined functions »
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 | + | 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 === | ||
− | + | bool tossCoin() // SImple 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:
- A simple toss of a coin.
- A biased toss of a coin.
EASEA syntax
bool tossCoin() // SImple tosscoin
bool tossCoin(float bias) // Biased tossCoin
Example
if( tossCoin(0.1)){ ... }