Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void rect (int xp, int yp, int xs, int ys) {
- for (y=yp; y<=yp+ys; y++) {
- //xp is position on x
- grid[y][xp]=1; //xs is how long is on x
- grid[y][xp+xs]=1; //every loop set 2 lines in array grid[][]
- }
- for (x=xp; x<=xp+xs; x++) {
- grid[yp][x]=1;
- grid[yp+ys][x]=1;
- }
- }
Add Comment
Please, Sign In to add comment