Computer Science Canada

printing out a row of stars

Author:  Tricia [ Fri Nov 12, 2004 9:18 pm ]
Post subject:  printing out a row of stars

i need help coz i wrote this code and it's not displaying anything...wat's wrong with it?
code:
    var sides := 10
    for star : 1 .. 10
        drawfillstar (sides, 400, sides + 40, 450, 14)
        sides += 30 * 2
    end for

Author:  zylum [ Fri Nov 12, 2004 9:26 pm ]
Post subject: 

your y values are too high and the stars are being drawn off the screen:

code:
var sides := 10
for star : 1 .. 10
    drawfillstar (sides, 200, sides + 40, 250, 14)
    sides += 30 * 2
end for

Author:  Tricia [ Fri Nov 12, 2004 9:26 pm ]
Post subject: 

please someone help?? i kno it's realy very basic but i seriously can't figure it out Embarassed Embarassed

Author:  Tricia [ Fri Nov 12, 2004 9:28 pm ]
Post subject: 

zylum wrote:
your y values are too high and the stars are being drawn off the screen:

code:
var sides := 10
for star : 1 .. 10
    drawfillstar (sides, 200, sides + 40, 250, 14)
    sides += 30 * 2
end for


sorry i kinda passed ur post but thanks for the help Very Happy

Author:  Tricia [ Fri Nov 12, 2004 9:42 pm ]
Post subject: 

i don't think the code you gave me is working

Author:  zylum [ Fri Nov 12, 2004 9:47 pm ]
Post subject: 

it works for me...

try this:

code:
var stars := 10
var Width := 30
var spaceWidth := 20
for star : 1 .. stars
    drawfillstar (Width * star + spaceWidth * star, maxy div 2 - Width div 2, Width * star + Width + spaceWidth * star, maxy div 2 + Width div 2, 14)
end for

Author:  Tricia [ Fri Nov 12, 2004 9:53 pm ]
Post subject: 

k thanks


: