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

Username:   Password: 
 RegisterRegister   
 Who can tell me how to make a line
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Rudiger




PostPosted: Tue Oct 07, 2003 8:27 pm   Post subject: Who can tell me how to make a line

i need someone to tell me how to make a line. I don't want someone saying jsut put
put "******************************************************"
i need a code
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Tue Oct 07, 2003 8:39 pm   Post subject: (No subject)

put "__________________________" Twisted Evil

no i am just kidding Razz

the line comand is somthing like this:

code:

drawline(0,0,100,100, red)


where it is drawline(x1, y1, x2, y2, color)

also Draw.Line wroks the same way
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Rudiger




PostPosted: Tue Oct 07, 2003 8:50 pm   Post subject: (No subject)

thanx man you just gave me a a+ or a high mark Very Happy
PaddyLong




PostPosted: Tue Oct 07, 2003 9:27 pm   Post subject: (No subject)

or to be really cool put repeat("_", 10)
Dan




PostPosted: Wed Oct 08, 2003 11:11 am   Post subject: (No subject)

why not just do

loop
put "_"..
end loop

never ending lines Shocked
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Blade




PostPosted: Wed Oct 08, 2003 12:41 pm   Post subject: (No subject)

could also use locate(row,col) to move yer line around
Tony




PostPosted: Wed Oct 08, 2003 1:18 pm   Post subject: (No subject)

well while we're on the topic of useless sujestions for making lines
code:

loop
Draw.Line(Rand.Int(0,maxx),Rand.Int(0,maxy),Rand.Int(0,maxx),Rand.Int(0,maxy),Rand.Int(0,255))
end loop
Laughing
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Mazer




PostPosted: Wed Oct 08, 2003 3:28 pm   Post subject: (No subject)

the best way to draw a line:
code:

for i : 1 .. 100
    drawdot (i, i, 7)
end for
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Wed Oct 08, 2003 3:54 pm   Post subject: (No subject)

who said that the line must be straight?
code:

for i:1..maxx
Draw.Dot(i,round(cos(i))+round(maxy/2),black)
end for
Laughing
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
naoki




PostPosted: Wed Oct 08, 2003 6:01 pm   Post subject: (No subject)

i think there's like undocumented functions in drawline like drawthickline or drawdashedline. and in those you specify the thickness of the line.
Rudiger




PostPosted: Wed Oct 08, 2003 9:42 pm   Post subject: (No subject)

This line has to be straight
a haziontal line Mad
like this ___________________
i just want a line to divide up 2 section in the porgram Wink
Tony




PostPosted: Wed Oct 08, 2003 10:05 pm   Post subject: (No subject)

well PaddyLong already answered your question then...
code:

put repeat("_", 10)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
who cares?




PostPosted: Wed Oct 08, 2003 10:18 pm   Post subject: (No subject)

GOD YOU PEOPLE HAVE WAY TOO MUCH TIME ON YOUR HANDS!!! Laughing
hackman




PostPosted: Thu Oct 09, 2003 10:11 am   Post subject: (No subject)

You forgot one
Vertical line:
code:

for k:1..20
put "|"
end for
Blade




PostPosted: Thu Oct 09, 2003 1:40 pm   Post subject: (No subject)

no... if you want to divide the screen in half... do this

code:
drawline(0,maxy div 2,maxx,maxy div 2,black)


okay, all it does is draw a line... the first two numbers being the x,y coordinates of the one end of the line, then the next two numbers are the x,y coordinates of the second part of the line, then the last one can be a colour name or a colour number. so its really
drawline(x1,y1,x2,y2,black)

ex: drawline(0,50,100,50,black)

0,50 - xy coordinate of the one end of the line
100,50 - xy coordinate of the other end
black - colour

since both y's are 50 it will be a straight horizontal line
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 2  [ 27 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: