Question
This should be a java code I have the following data from my text file: Tile 1: B,B,Y,O,P,G Tile 2: O,B,G,Y,P,Y Tile 3: P,G,B,R,B,Y Tile
This should be a java code
I have the following data from my text file:
Tile 1: B,B,Y,O,P,G Tile 2: O,B,G,Y,P,Y Tile 3: P,G,B,R,B,Y Tile 4: O,B,P,O,Y,G Tile 5: O,R,O,B,P,R
Tile 6: R,Y,R,O,P,B Tile 7: O,G,R,O,G,G
I want to create non-static read method that can read the characters from my file.
I am using the following to begin reading the data where the path is the string name of my file:
DataInputStream input = new DataInputStream(new BufferedInputStream(new FileInputStream(path)));
I do not want to read "Tile #:" I only need to read the characters. I know that I can just erase the Tile #: portion but future inputs will always follow this format
so I need my read method to be selective on what is read and what is not read. I want my read method to read the list not the title of the list. The read method will then put each list into different separate character arrays. Can you write this code for java?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started