Computer Science Canada

need help

Author:  Bskll [ Sun Nov 07, 2004 9:15 pm ]
Post subject:  need help

this is my code so far
code:
var colorline : int
colorback(black)

loop
randint(colorline, 0, maxcolor)
Draw.ThickLine(0,maxy div 2, maxx, maxy div 2, 10, colorline)
delay(75)
cls
Draw.ThickLine(0,0,maxx, maxy, 10, colorline)
delay(75)
cls
Draw.ThickLine(maxx div 2, 0, maxx div 2, maxy, 10, colorline)
delay(75)
cls
Draw.ThickLine(maxx, 0, 0, maxy, 10, colorline)
delay(75)
cls
for i : 0..100
    drawoval(maxx div 2, maxy div 2, i-100, i-100, colorline)
    drawoval(maxx div 2, maxy div 2, i+100, i+100, colorline)
cls
end for
delay(100)
end loop



how do i make the circle go faster ie. make it skip 5 pixel at a time?

Author:  Tony [ Sun Nov 07, 2004 9:18 pm ]
Post subject: 

code:

for i:1..100 by 5
..

read more about loops here

Author:  Bskll [ Sun Nov 07, 2004 9:24 pm ]
Post subject: 

thanks

Author:  myob [ Mon Nov 08, 2004 7:15 am ]
Post subject: 

tony wrote:
code:

for i:1..100 by 5
..

read more about loops here


that's interesting, never thought of that. i would go
code:
for i : 1 .. 100
radius := i * 5


just other variations, dont get too into detail, each got its ups and downs

Author:  Tony [ Mon Nov 08, 2004 10:56 am ]
Post subject: 

myob - your code will go up to 500 instead of 100 Wink

Author:  myob [ Mon Nov 08, 2004 5:18 pm ]
Post subject: 

i know that, but since i see urs is an example, mine was just another example without deep thought, if u look on his program, his intention was to draw 100 circles. if he uses u loop he only draws 20 circles Very Happy


: