Computer Science Canada

Drawdot

Author:  jolly50 [ Mon Oct 29, 2007 7:51 pm ]
Post subject:  Drawdot

Hey

How would you put a draw dot in a for loop?
I need it to put out 1 dot at every 10 pixels

I thought that it might look something like this?

code:


setscreen ("graphics")

for
    put drawdot (50,300,0)..(200,300,15)
   
end for




Thanks for any help!

Author:  Nick [ Mon Oct 29, 2007 7:58 pm ]
Post subject:  RE:Drawdot


Edited by Clayton:

[deletia]

No doing other people's work for them!

Author:  Clayton [ Mon Oct 29, 2007 8:10 pm ]
Post subject:  RE:Drawdot

I suggest looking at the example program that is in the help file under drawdot. Or even better yet, use Draw.Dot(), which does the exact same thing, except makes things much clearer.

Author:  jolly50 [ Mon Oct 29, 2007 8:17 pm ]
Post subject:  RE:Drawdot

hes not doing the work for me...he was just showing me where I was wrong

Author:  Cervantes [ Mon Oct 29, 2007 8:46 pm ]
Post subject:  RE:Drawdot

You have to realize that your syntax is all wrong there, let alone the concept. A for loop requires an integer counter and a range to count over. It seems like you're hoping the for loop will take some arbitrary... gah, I don't even know how to describe that construct. First, put needs to take in a value, but drawdot doesn't return a value: it prints a dot on the screen and doesn't return anything (which is different from returning nothing (nil)). Next, you can't specify a range of drawdots. What does that even mean? I can't figure out what that is supposed to mean, so how could a computer ever hope to?

Author:  Zampano [ Tue Oct 30, 2007 12:47 pm ]
Post subject:  Re: Drawdot

You'll need to declare a variable for the coordinates of the dots you re trying to move.
The computer won't be generous enough to work out the nuts and bolts of the for loop itself.
You need to specify the variable to start and stop at.
Use that variable for the coordinates of the dots.
Remember that whenever you have a problem with something relatively basic like this, the help file (coupled with some problem-solving thought) should end your troubles nearly always.

Author:  jolly50 [ Tue Oct 30, 2007 4:34 pm ]
Post subject:  RE:Drawdot

its all right....i figured it out with some help from momop


: