alDente method

bool alDente(
  1. dynamic myConditionFunc,
  2. dynamic yourConditionFunc,
  3. bool condition
)

TODO teamAdm Suspended..(find errors) partly untested Base type of alDente func MAKE THIS TO BE SO

Implementation

bool alDente(var myConditionFunc, var yourConditionFunc, bool condition) {
  //  supposing; condition =   false at the beginning.
  bool _condition = condition; //  copy parameter to local variable
  num _counter = 0; //  set local counter
  num _counterMax = 3; //  preventing endless loop

  bool _f = false;
  bool _s = false;
  do {
    _f = myConditionFunc();
    _s = yourConditionFunc();
    _counter++;
    if (_f == true) {
      if (_s == true) {
        (_condition = true);
        isAlDente = true;
      }
    }
    ;
    if (_counter == _counterMax) (_condition = true);
  } while (_condition);
  isAlDente = false; // set global variable to false again
  return _condition; // use this return value
}