Results 1 to 2 of 2
- 05-30-2012, 03:10 PM #1Member
- Join Date
- May 2012
- Rep Power
Getting Java To Use Values In A Text File
I'm a beginner programmer, and I want to use values written in a text file in my java program.
I don't want to enter the strings directly into the program code.
It is difficult to explain, but I'll try. I have a text file with:
Title: Lost in the subway
situation1: you wake up on a bench in a subway tunnel. Do you:
action1: talk to the old lady at the platform
action2: wait for the train
situation2: the old lady looks away
action3: poke her
And I want Java to read the text file and display "Lost in the subway" as a title.
Then I want to display situation1, and then display the corresponding actions.
And then there is this in another text file:
s1: a1, a2
s2: a2, a3
And I want java to use this to display the actions that correspond with the situation.
If anyone could help me with this, that would be wonderful. I want to be able to write lots of stories, and not have to mess with the java code every time.
- 05-30-2012, 03:29 PM #2
- By Tedward in forum New To JavaReplies: 8Last Post: 06-02-2011, 04:28 AM
- By kryptonian03 in forum New To JavaReplies: 4Last Post: 03-22-2011, 06:13 AM
- By pds8475 in forum New To JavaReplies: 14Last Post: 01-22-2011, 02:36 PM
- By janeansley in forum New To JavaReplies: 40Last Post: 07-04-2008, 08:41 AM
- By dav9999 in forum New To JavaReplies: 8Last Post: 04-01-2008, 01:51 AM