Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int get_randypos(struct coordinates geometry_win, struct obstacleinfo *oi)
- {
- int i;
- int randpos;
- randpos = rand() % ((geometry_win.y - 2) - 1 + 1) + 1;
- for (i = 0; i < oi->count; i++)
- {
- while (1)
- {
- if (oi->obstacle[i]->y_pos == randpos)
- {
- randpos = rand() % ((geometry_win.y - 2) - 1 + 1) + 1;
- }
- else
- {
- break;
- }
- }
- }
- return randpos;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement