Files
  • Main.java
  • Users.txt

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.11376626988862881","path":"Main.java","file":{"path":"Main.java","content":{"asEncoding":{"base64":"Ly8KLy8gRGlzY2xhaW1lcjoKLy8gbXdpbGtpNzogVGhpcyBpcyBub3Qgb3JpZ2luYWxseSBteSByZXBsCi8vIFRoaXMgaXMgdG8gaGVscCBzb21lb25lIGluIHRoZSAiQXNrIiBzZWN0aW9uCi8vCmltcG9ydCBqYXZhLnV0aWwuU2Nhbm5lcjsKaW1wb3J0IGphdmEuaW8uRmlsZTsKaW1wb3J0IGphdmEuaW8uRmlsZU5vdEZvdW5kRXhjZXB0aW9uOwoKY2xhc3MgTWFpbgp7CiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKQogICAgewogICAgICAgIFN0cmluZ1tdIHVzZXIgPSBuZXcgU3RyaW5nWzddOwogICAgICAgIFN0cmluZ1tdIHVzZXJzY29yZSA9IG5ldyBTdHJpbmdbN107CiAgICAgICAgU3RyaW5nW10gdXNlcnBhc3N3b3JkID0gbmV3IFN0cmluZ1s3XTsKICAgICAgICByZWFkdXNlcmRhdGEodXNlcix1c2Vyc2NvcmUsdXNlcnBhc3N3b3JkKTsKICAgIH0KICAgIHB1YmxpYyBzdGF0aWMgdm9pZCByZWFkdXNlcmRhdGEoU3RyaW5nW10gdXNlciwgU3RyaW5nW10gdXNlcnNjb3JlLCBTdHJpbmdbXSB1c2VycGFzc3dvcmQpCiAgICB7CiAgICAgICAgdHJ5CiAgICAgICAgewogICAgICAgICAgICBGaWxlIGZpbGUgPSBuZXcgRmlsZSgiVXNlcnMudHh0Iik7CiAgICAgICAgICAgIFNjYW5uZXIgaW5wdXRmaWxlID0gbmV3IFNjYW5uZXIoZmlsZSk7CgogICAgICAgICAgICBmb3IoaW50IGluZGV4ID0gMDsgaW5kZXggPCA2ICYmIGlucHV0ZmlsZS5oYXNOZXh0KCk7IGluZGV4ICsrICkKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgdXNlcltpbmRleF0gPSBpbnB1dGZpbGUubmV4dCgpOwogICAgICAgICAgICAgICAgdXNlcnNjb3JlW2luZGV4XSA9IGlucHV0ZmlsZS5uZXh0KCk7CiAgICAgICAgICAgICAgICB1c2VycGFzc3dvcmRbaW5kZXhdID0gaW5wdXRmaWxlLm5leHQoKTsKICAgICAgICAgICAgfQogICAgICAgICAgICAvLyBVc3VhbGx5IGxlc3MgdGhhbiA8LCBub3QgbGVzcyB0aGFuIGVxdWFscyA8PQogICAgICAgICAgICBmb3IoaW50IGluZGV4ID0gMDsgaW5kZXggPCA2OyBpbmRleCArKyApCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbih1c2VyW2luZGV4XSArICIgIiArIHVzZXJzY29yZVtpbmRleF0pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGZvcihpbnQgaW5kZXggPSAwOyBpbmRleCA8IDY7IGluZGV4ICsrICkKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgCiAgICAgICAgICAgIH0KICAgICAgICAgICAgLy9pbnB1dGZpbGUuY2xvc2UoKTsgCiAgICAgICAgfSBjYXRjaCAoRmlsZU5vdEZvdW5kRXhjZXB0aW9uIGV4KQogICAgICAgIHsKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJGaWxlIG5vdCBmb3VuZCBlcnJvci4gIik7CiAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGV4KQogICAgICAgIHsKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJTb21ldGhpbmcgZWxzZSBoYXMgZ29uZSB3cm9uZy4iKTsKICAgICAgICB9ICAgICAgICAKICAgIH0KfQoK"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// Disclaimer:
// mwilki7: This is not originally my repl
// This is to help someone in the "Ask" section
//
import java.util.Scanner;
import java.io.File;
import java.io.FileNotFoundException;

class Main
{
    public static void main(String[] args)
    {
        String[] user = new String[7];
        String[] userscore = new String[7];
        String[] userpassword = new String[7];
        readuserdata(user,userscore,userpassword);
    }
    public static void readuserdata(String[] user, String[] userscore, String[] userpassword)
    {
        try
        {
            File file = new File("Users.txt");
            Scanner inputfile = new Scanner(file);

            for(int index = 0; index < 6 && inputfile.hasNext(); index ++ )
            {
                user[index] = inputfile.next();
                userscore[index] = inputfile.next();
                userpassword[index] = inputfile.next();
            }
            // Usually less than <, not less than equals <=
            for(int index = 0; index < 6; index ++ )
            {
                System.out.println(user[index] + " " + userscore[index]);
            }
            for(int index = 0; index < 6; index ++ )
            {
                
            }
            //inputfile.close(); 
        } catch (FileNotFoundException ex)
        {
            System.out.println("File not found error. ");
        } catch (Exception ex)
        {
            System.out.println("Something else has gone wrong.");
        }        
    }
}