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

Username:   Password: 
 RegisterRegister   
 how to draw lines
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
GhettoSingh




PostPosted: Mon Jun 09, 2003 9:34 pm   Post subject: how to draw lines

i need to draw a grid with 7 columns and 5 rows can anyone tell me how to draw lines or if there is a specific command for drawing grids.
Sponsor
Sponsor
Sponsor
sponsor
AsianSensation




PostPosted: Mon Jun 09, 2003 9:40 pm   Post subject: (No subject)

drawline(x1,y1,x2,y2,color)
as for the grid, draw the line using a for loop(im assuming you know for loops)
Tony




PostPosted: Mon Jun 09, 2003 9:41 pm   Post subject: (No subject)

Draw.Line(x1,y1,x2,y2,color)

to draw a grid, you just use two forloops. One for horizontal lines, one for vertical
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
GhettoSingh




PostPosted: Mon Jun 09, 2003 9:42 pm   Post subject: (No subject)

i'm not too sure about them loops but i will try
PaddyLong




PostPosted: Mon Jun 09, 2003 9:47 pm   Post subject: (No subject)

a basic one that grids up the entire window Smile

code:

var spaceBetweenGrids : int := 10

for q : 1 .. maxx - 1 by spaceBetweenGrids
    for w : 1 .. maxy - 1 by spaceBetweenGrids
        drawline (0, w, maxx, w, 7)
        drawline (q, 0, q, maxy, 7)
    end for
end for
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  [ 5 Posts ]
Jump to:   


Style:  
Search: