alDenteOne function
alDenteXxx functions roll until condition is set (but no more than 3 times)
Implementation
//TODO teamAdm Function : seems to be too complicated
//TODO teamAdm logic not checked. So... very good material for classroom
bool alDenteOne(var myConditionFunc, var yourConditionFunc, bool condition) {
//NOTE: should function parameters be bool? Add msg-String parameter
// supposing; condition = false.. at the beginning => don't execute
// set condition to local variaböe
num _counter = 0;
num _counterMax = 3;
bool _f = false;
bool _s = false;
do {
_f = myConditionFunc(); //paraeter functions set values to local vars
_s = yourConditionFunc();
_counter++;
if (_f == true) {
if (_s == true) {
(condition = true);
isAlDente = true; //Global variable
}
}
;
if (_counter == _counterMax) (condition = true);
} while (condition);
isAlDente = false; //return to default state
return condition;
}