Okay, if I could, I would shoot my CS teacher, and then shoot myself.

Reality check. Done.

Anyways, check out this yucky program right here...I don't even know where to begin...we need to create a new drawing pad; and by using two methods, we would have to create this illusion image by using only parallel lines and shaded "rectangles". Here's the link to the assignment, since I can't copy or save his files:

Click on Assignment dated 10/25/04, practice with For Loops

Username: cs2
password: 89106

I know I'm asking you guys to go through alot, but I really need help on this. This is a challenging program, and most of the older kids in my class are having BIG trouble solving this assignment...

I'm going to work on it now and see what stuff I can come up with. But please, if you got spare time, take a quick look at the program and see if you can help. Thanks ALOT!!!

Given the date of the assignment, I think I can assume that it's already been due so I suppose I could try and answer it.
I kind of mixed basic and c++ code structures, but I think something like this would work. The only slightly tedious part is the row's offset. It's just nested loops, nothing really tricky here.

offset = 0
flag = 0
for y = 0 to 7
	for x = 0 to 13 step 2
		pen.setPosition(x*40 + offset,y*40)
		pen.fillRect(40,40)
		
		pen.setPosition(0 ,(y+1)*40)
		pen.drawLine(0,endOfScreen)  
	next x
	//determine whether to increase or decrease the offset of the row
	//offsets by 3 each time
	if flag = 0 and offset = 6
	{
		flag = 1
	}
	if flag = 1 and offset = 0
	{
		flag = 0
	}
	if flag = 0 then offset += 3
	if flag = 1 then offset -= 3
next y

As for the circles, I don't know what its suppose to look like.

Hmm...thanks for replying JUST in time. Luckily, this is due tomorrow, so at least I got some help for now.

I got the circles part myself...lemme see if your code works, Phaelax. and Thanks ALOT!! ^^

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.