Inspiration

Finding friends

What it does

Matches people together

How we built it

Processing

Challenges we ran into

Everything

Accomplishments that we're proud of

Stuff

What we learned

Teamwork

What's next for Over Coffee

Fixing bugs. Make it work.

ArrayList users = new ArrayList();

import controlP5.*; ControlP5 controlP5;

Textfield userTextField; Textfield passTextField;

boolean searchDone;

PFont f;

int index;

boolean loggedIn; String myName; int myAge; String[] myInterest = new String[6]; int myZip; String myPlace; String myUserName; String myPassword;

boolean[] compatible = new boolean[100];

void setup () { size(1024, 600); background(#7AF4A1); frameRate(30); controlP5 = new ControlP5(this); f = createFont("Arial", 30, true); textFont(f); userTextField = controlP5.addTextfield("user", (int) width/20, (int) (height/1.4), (int)(width*530/600), 60); passTextField = controlP5.addTextfield("pass", (int) width/20, (int) (height/1.2), (int)(width*530/600), 60); } /* top top left 30,730 bottom left 30, 790 top right 560, 730 bottom left 560, 790

bottom top left 30, 850 bottom left 30, 920 top right 560, 850 bottom right 560, 920 / void menu () { PImage menu = loadImage("ScreenDesign.jpg"); background(#7AF4A1); image(menu, width/2 - (int) height/3.4, 0, (int) height/1.7, height); controlP5.addButton("enter").setPosition(width/2 - 40, height - 30).setSize(80, 20); / if (mousePressed && mouseX >= width/20 && mouseX <= (int) width/1.07 && mouseY >= (int) height/1.4 && mouseY <= (int) height/1.3) { onUser = true; onPass = false; } if (mousePressed && mouseX >= width/20 && mouseX <= (int) width/1.07 && mouseY >= (int) height/1.2&& mouseY <= (int) height/1.11) { onPass = true; onUser = false; }

if (onUser) { if (keyPressed && keyCode >='a' && keyCode <='z') { user = user + key; userLength++; } } if (onPass) { if (keyPressed && keyCode >='a' && keyCode <='z') {
passLength++; pass = pass+ key; passLength++; } }

//textSize(height*0.06); if (user != null) text(user, (int) width/20, (int) height/1.4); if (pass != null) text(pass, (int) width/20, (int) height/1.2); */ }

void draw () { String[] usernames = loadStrings("usernames.txt"); String[] passwords = loadStrings("passwords.txt"); String[] ages = loadStrings("ages.txt"); String[] zips = loadStrings("zips.txt"); String[] interests1 = loadStrings("interests1.txt"); String[] interests2 = loadStrings("interests2.txt"); String[] interests3 = loadStrings("interests3.txt"); String[] interests4 = loadStrings("interests4.txt"); String[] interests5 = loadStrings("interests5.txt"); String[] interests6 = loadStrings("interests6.txt"); String[] names = loadStrings("names.txt");

if(loggedIn){ if(!searchDone){ search(); searchDone = true; } background(#7AF4A1); for(int i = 0; i < 100; i++){ if(compatible[i]){ textFont(f); text(names[i]+ " " + interests1[i] + " " + interests2[i] + " " + interests3[i]+ " " + interests4[i]+ " " + interests5[i]+ " " + interests6[i] + " " + zips[i]); } } menu();

}

class User { String[] usernames = loadStrings("usernames.txt"); String[] passwords = loadStrings("passwords.txt"); String[] ages = loadStrings("ages.txt"); String[] zips = loadStrings("zips.txt"); String[] interests1 = loadStrings("interests1.txt"); String[] interests2 = loadStrings("interests2.txt"); String[] interests3 = loadStrings("interests3.txt"); String[] interests4 = loadStrings("interests4.txt"); String[] interests5 = loadStrings("interests5.txt"); String[] interests6 = loadStrings("interests6.txt"); String[] names = loadStrings("names.txt");

String name; int age; String[] interest = new String[6]; int zip; String place; String userName; String password;

User (int ind) { age = int(ages[ind]); zip = int(zips[ind]); name = names[ind]; age = int(ages[ind]); for (int j = 0; j < 6; j++) { myInterest[j] = interests1[ind]; myInterest[j] = interests1[ind]; myInterest[j] = interests1[ind]; myInterest[j] = interests1[ind]; myInterest[j] = interests1[ind]; myInterest[j] = interests1[ind]; } }

int checkComp (User a, User b) { int compatability = 0; for (int c = 0; c < a.interest.length; c++) { for (int d = 0; d < b.interest.length; d++) { if (a.interest[c] == b.interest[d]) compatability++; } }

if (a.age <= b.age + 3 && a.age >= b.age - 3)
  compatability += 3;
return compatability;

} }

void enter(float theValue) { String[] usernames = loadStrings("usernames.txt"); String[] passwords = loadStrings("passwords.txt"); String[] ages = loadStrings("ages.txt"); String[] zips = loadStrings("zips.txt"); String[] interests1 = loadStrings("interests1.txt"); String[] interests2 = loadStrings("interests2.txt"); String[] interests3 = loadStrings("interests3.txt"); String[] interests4 = loadStrings("interests4.txt"); String[] interests5 = loadStrings("interests5.txt"); String[] interests6 = loadStrings("interests6.txt"); String[] names = loadStrings("names.txt");

String user = userTextField.getText(); String pass = passTextField.getText();

for (int i = 0; i < usernames.length; i++) { if (user == usernames[i] && pass == passwords[i]) { loggedIn = true; myName = names[i]; int myAge; String[] myInterest = new String[6]; for (int j = 0; j < 6; j++) { myInterest[j] = interests1[i]; myInterest[j] = interests1[i]; myInterest[j] = interests1[i]; myInterest[j] = interests1[i]; myInterest[j] = interests1[i]; myInterest[j] = interests1[i]; } int myZip = int(zips[i]); String myUserName = usernames[i]; String myPassword = passwords[i];

  index = i;
}

} }

boolean checkComp (User a, User b) { String[] usernames = loadStrings("usernames.txt"); String[] passwords = loadStrings("passwords.txt"); String[] ages = loadStrings("ages.txt"); String[] zips = loadStrings("zips.txt"); String[] interests1 = loadStrings("interests1.txt"); String[] interests2 = loadStrings("interests2.txt"); String[] interests3 = loadStrings("interests3.txt"); String[] interests4 = loadStrings("interests4.txt"); String[] interests5 = loadStrings("interests5.txt"); String[] interests6 = loadStrings("interests6.txt"); String[] names = loadStrings("names.txt");

int compatability = 0; for (int c = 0; c < a.interest.length; c++) { for (int d = 0; d < b.interest.length; d++) { if (a.interest[c] == b.interest[d]) compatability++; } }

if (a.age <= b.age + 3 && a.age >= b.age - 3) compatability += 3; if (compatability > 5) return true; else return false; } void search () { String[] usernames = loadStrings("usernames.txt"); String[] passwords = loadStrings("passwords.txt"); String[] ages = loadStrings("ages.txt"); String[] zips = loadStrings("zips.txt"); String[] interests1 = loadStrings("interests1.txt"); String[] interests2 = loadStrings("interests2.txt"); String[] interests3 = loadStrings("interests3.txt"); String[] interests4 = loadStrings("interests4.txt"); String[] interests5 = loadStrings("interests5.txt"); String[] interests6 = loadStrings("interests6.txt"); String[] names = loadStrings("names.txt");

for (int i = 0; i < names.length; i++) users.add(new User(i)); for (int i = 0; i < names.length; i++) { if (checkComp(users.get(index), users.get(i))) compatible[i] = true; } }

void display () {

}

Share this project:

Updates