Computer Science Canada help with filling grid boxes |
Author: | insanesniper23 [ Wed Dec 10, 2014 9:59 am ] |
Post subject: | help with filling grid boxes |
What is the problem you are having? <hey there im trying to figure out how to drawfill between two already filled boxes in a 20 by 20 black grid i have it so the user clicks on a square of the grid for the start and then click on another square after that i want it to fill the space in between those two colored squares> |
Author: | Dreadnought [ Wed Dec 10, 2014 1:27 pm ] |
Post subject: | Re: help with filling grid boxes |
Suppose that your squares are from (a1,b2) to (a2,b2) and from (x1,y1) to (x2,y2) then you can fill in the area from (min(a1,a2,x1,x2), min(b1,b2,y1,y2)) to ((max(a1,a2,x1,x2), max(b1,b2,y1,y2)). |