Guest User

Untitled

a guest
Mar 23rd, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. void rect (int xp, int yp, int xs, int ys) {
  2. for (y=yp; y<=yp+ys; y++) {
  3. //xp is position on x
  4. grid[y][xp]=1; //xs is how long is on x
  5. grid[y][xp+xs]=1; //every loop set 2 lines in array grid[][]
  6. }
  7. for (x=xp; x<=xp+xs; x++) {
  8. grid[yp][x]=1;
  9. grid[yp+ys][x]=1;
  10. }
  11. }
Add Comment
Please, Sign In to add comment