BYTE CLlinesDoc::throwBalls() { BYTE back; srand( (unsigned)time( NULL ) ); //initialize random generator for(int i =0;i<NUMB_THRW_BALLS;i++) do { BYTE x = rand()%9; BYTE y = rand()%9; int j = rand()%5 +1; if ((back = throwBall(j,x,y))== END) { // gameFinished(); return 0; } } while(back != SUCCESS ); // nextBalls(); // drawNewBalls(); // Check end of game if (numFree <= 0) // gameFinished(); return 0; return 1; }
void Skybert::action() { printBalls(); std::cout << std::endl; throwBall(); }