Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 printing out a row of stars
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Tricia




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
zylum




PostPosted: Fri Nov 12, 2004 9:26 pm   Post subject: (No 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
Tricia




PostPosted: Fri Nov 12, 2004 9:26 pm   Post subject: (No subject)

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




PostPosted: Fri Nov 12, 2004 9:28 pm   Post subject: (No 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
Tricia




PostPosted: Fri Nov 12, 2004 9:42 pm   Post subject: (No subject)

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




PostPosted: Fri Nov 12, 2004 9:47 pm   Post subject: (No 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
Tricia




PostPosted: Fri Nov 12, 2004 9:53 pm   Post subject: (No subject)

k thanks
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: