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.
Re: Getting Java To Use Values In A Text File
I'd recommend doing a quick google search of "java file io" as a first stab.