I am trying to make a a program that will take the graphing screen and evaluate each pixel in a 30×30 square. If the particular pixel is adjacent to two on pixels it will stay on, otherwise it will turn off. I tried using two nested "For" loops, one for "x" and one for "y" ex. for(y,2,31):for(y,2,31). Then inside the loops I used a series of "if" statements to check if the pixels to the left,right,up, and down where on. ex. if pxl-test(x,y+1):then:L+1→1:end This is where my problem lies… The first time the loops run I get a Domain error. I dont understand why this is happening because I started the loops at "2" not 1.
Thanks for the help in advance!,
Zach