Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Board::initBoard(){
- emptyCell.clear();
- for (int i = 0; i < BOARD_HEIGHT; i++){
- for (int j = 0; j < BOARD_WIDTH; j++){
- boardM[i][j] = 0;
- Cell c;
- c.posX = i;
- c.posY = j;
- emptyCell.push_back(c);
- }
- }
- }
- void Board::randomBall(){
- srand (time(NULL));
- int prand = rand() % emptyCell.size();
- boardM[ emptyCell[prand].posX ][ emptyCell[prand].posY ] = rand() % 6 + 1;
- emptyCell.erase(emptyCell.begin() + prand);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement