I'm trying to randomly import a file that has a Sudoku puzzle in it into an array and then import its answers into another array. I'm getting the random number beforehand and passing it into the function GetCharactersFromFile. Both Files are located in different dirs b/c they have the same file name so that they can be easily matched.
Code:
public void GetCharactersFromFile(int a)
{
FileReader inputStream = null;
FileWriter outputStream = null;
try {
inputStream = new FileReader("SourceFiles\\puzzles\\1.txt");
outputStream = new FileWriter("SourceFiles\\solns\\1.txt");
...
Right now I just have files that I know exist so I can get it to work for now
I am getting error:
"Unhandled exception type FileNotFoundException" for puzzles
"Unhandled exception type IOException" for solns"
I've tried \, \\, /, //, everything I can think of, including the full path from the root /home/nhenry/..., but that didn't work and I'd like to avoid full path b/c I'm going to have to turn in to a teacher who is using windows
any help would be appreciated
Code:
public void GetCharactersFromFile(int a)
{
FileReader inputStream = null;
FileWriter outputStream = null;
try {
inputStream = new FileReader("SourceFiles\\puzzles\\1.txt");
outputStream = new FileWriter("SourceFiles\\solns\\1.txt");
...
Right now I just have files that I know exist so I can get it to work for now
I am getting error:
"Unhandled exception type FileNotFoundException" for puzzles
"Unhandled exception type IOException" for solns"
I've tried \, \\, /, //, everything I can think of, including the full path from the root /home/nhenry/..., but that didn't work and I'd like to avoid full path b/c I'm going to have to turn in to a teacher who is using windows
any help would be appreciated