The Mother Board

Motherboards.org forums. Free tech support, motherboard ID, and more.
It is currently Mon Nov 19, 2018 2:06 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Mar 15, 2006 7:20 am 
Offline
Black Belt 4th Degree
Black Belt 4th Degree

Joined: Sun Dec 28, 2003 8:26 pm
Posts: 4941
Location: Norwich, UK
Can anybody help?

I'm trying to read in ints from a txt file, but the ints need to be assigned in a special way if the word start or goal is on the next line. How can I read the line and if the next line is one of the words use the ints?

Code:
else while(inReader != null){
                    try{
                        inFile.mark(3);
                        inFile.readLine();
                        if (inFile.readLine() == "Start"){
                            inFile.reset();
                            String pos = inFile.readLine();
                            char i = pos.charAt(0);
                            char j = pos.charAt(2);
                            inFile.readLine();
                            inFile.mark(3);
                        }


That's what I'm trying at the moment. Any ideas?

_________________
Image
Jocuri cu impuscaturi si alte genuri, pentru toate varstele doar pe acest link - distractie si amuzament garantat!


Top
 Profile  
Reply with quote  
 Post subject: more information
PostPosted: Tue Mar 28, 2006 12:07 pm 
Offline
Initiate
Initiate

Joined: Thu Jan 30, 2003 8:42 pm
Posts: 41
Not sure I understand what you are trying to do.

Can you provide an example of the type of data in your text file?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Mar 28, 2006 12:09 pm 
Offline
Black Belt 4th Degree
Black Belt 4th Degree

Joined: Sun Dec 28, 2003 8:26 pm
Posts: 4941
Location: Norwich, UK
Well I've done it now, it was to read in numbers seperated by a space from a text file. I'm now working on a maze game built in java, nearly there now!

_________________
Image
Jocuri cu impuscaturi si alte genuri, pentru toate varstele doar pe acest link - distractie si amuzament garantat!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group