
-----------------------------------
laci211
Thu Nov 22, 2007 1:23 pm

Help me make a program
-----------------------------------
This is what i need to do and i have no clue how to do it
Use loops and pixel graphics to write a program that will do the following:
	&#10063;	ask the user for a number n between 3 and 10
	&#10063;	execute a loop n times
	&#10063;	this loop will create a square in the middle of the screen that is 200 pixels wide
	&#10063;	then it will create a square in the centre of the original square that is 180 pixels wide
	&#10063;	this will go on for decreasing squares, of different colours until there are n squares within each other, each square is 20 pixels less than the previous.

I need your help
Thanks

-----------------------------------
Zampano
Thu Nov 22, 2007 1:50 pm

Re: Help me make a program
-----------------------------------
There's little way we can help without telling you an answer. Just get the number, execute a forloop from 1 to the number. A rand.int must be used for the outline. Also have a counter that goes down ten each time the forloop happens. This is for the square. Just use drawbox(maxx/2-the decreasing counter,maxy/2-counter,maxx/2+the counter,maxy/2+counter,rand.int)
Then you're set.
