mirror of
https://github.com/smyalygames/kahoot-challenge-2025.git
synced 2025-05-18 09:14:15 +02:00
feat: add argument for file
This commit is contained in:
parent
cfe6a78750
commit
5d5c295ac4
@ -6,16 +6,15 @@ public class Main {
|
||||
// Get commandline arguments
|
||||
// Checks that only the file has been declared
|
||||
|
||||
// TODO Add arguments to read files from
|
||||
// if (args.length != 1) {
|
||||
// System.out.println("Invalid arguments, you need to define the text file to read from!");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// System.out.println(Arrays.toString(args));
|
||||
if (args.length != 1) {
|
||||
System.out.println("Invalid arguments, you need to define the text file to read from!");
|
||||
return;
|
||||
}
|
||||
|
||||
Path filePath = Path.of(args[0]);
|
||||
|
||||
// Get the data from the file
|
||||
List<String> data = ReadFile.open(Path.of("example.txt"));
|
||||
List<String> data = ReadFile.open(filePath);
|
||||
|
||||
// Gets a map with the total occurrences for each domain
|
||||
Map<String, Integer> domains = getDomainTotal(data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user