Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.Arrays;
- public class UltimateBravery {
- public static String bar[] = null;
- public static int count = 0;
- public static String boots[] = null;
- public static String spells[] = null;
- public static String champs[] = null;
- public static String skills[] = null;
- public static String items[] = null;
- public static int linecount(BufferedReader file) {
- try {
- while(file.readLine() != null) {
- count++;
- }
- file.close();
- }
- catch (Exception ex) {
- ex.printStackTrace();
- }
- return count;
- }
- public static String[] readfile(String foo) {
- try {
- count = 0;
- BufferedReader br = new BufferedReader (new FileReader (foo));
- bar = new String[linecount(br)];
- br = new BufferedReader (new FileReader (foo));
- for(int i = 0; i <= count-1 ; i++) {
- bar[i] = br.readLine();
- }
- return bar;
- }
- catch (IOException blargh) {
- System.out.println(blargh.getMessage());
- }
- return bar;
- }
- public static void main(String[] args) {
- readfile("bin\\boots.txt");
- boots = Arrays.copyOf(bar, bar.length);
- readfile("bin\\spells.txt");
- spells = Arrays.copyOf(bar, bar.length);
- readfile("bin\\champs.txt");
- champs = Arrays.copyOf(bar, bar.length);
- readfile("bin\\skills.txt");
- skills = Arrays.copyOf(bar, bar.length);
- readfile("bin\\items.txt");
- items = Arrays.copyOf(bar, bar.length);
- for(int i = 0; i < boots.length; i++) {
- System.out.println(boots[i]);
- }
- for(int i = 0; i < spells.length; i++) {
- System.out.println(spells[i]);
- }
- for(int i = 0; i < champs.length; i++) {
- System.out.println(champs[i]);
- }
- for(int i = 0; i < skills.length; i++) {
- System.out.println(skills[i]);
- }
- for(int i = 0; i < items.length; i++) {
- System.out.println(items[i]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment