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

Username:   Password: 
 RegisterRegister   
 how can i sort two sets of data into a 2D array
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
jennil




PostPosted: Mon Jan 19, 2004 11:20 pm   Post subject: how can i sort two sets of data into a 2D array

I was wonderin if neone knows the code of entering data into a 2D arry and writin the two separate lists of int into a new text file?

this is probably really simple, but i havn't done this in a while! thnx!
Sponsor
Sponsor
Sponsor
sponsor
DanShadow




PostPosted: Mon Jan 19, 2004 11:29 pm   Post subject: (No subject)

hmm...thats a little tough...but it might be something like this:
code:

var area:array 1..10, 1..10 of int
var x,y:int:=1
loop
array(x,y):=Rand.Int(1,99)
x:=x+1
y:=y+1
exit when x=11 or y=11
end loop
var datafile:int
open:datafile,"2d array",put
loop
put:datafile,array(x,y)
x:=x+1
y:=y+1
exit when x=11 or y=11
end loop
close:datafile

Im quite sure that wont work...(I dont have Turing on me right now).
But that might give you an idea, so either way, I hope it helps in some wa y. Very Happy
jennil




PostPosted: Mon Jan 19, 2004 11:31 pm   Post subject: (No subject)

thnx
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  [ 3 Posts ]
Jump to:   


Style:  
Search: