//YES or NO; a test of little logic and much patience
PFont font;
PFont small;
PFont smaller;
String letters = "";
String question = "YES or NO...?";
String question1 = "Do you like yes or no questions?";
String question2 = "Is this a yes or no question?";
String question3 = "And this?";
String question4 = "How about:\nIs the answer to this question no?";
String question5 = "Is the answer to this question no?";
String haha = "Hm...Stuck?";
String question6 = "Still like yes or no questions?";
String question7 = "Is this why\nyou don't like yes or no questions?";
String again = "Again?";
int back = 102;
int l = letters.length();
int mode = 0;
boolean like = true;
void setup() {
size(400, 400);
font = loadFont("Eureka-24.vlw");
small = loadFont("AuroraExtended-12.vlw");
smaller = loadFont("AuroraExtended-10.vlw");
fill(255);
}
void draw() {
background(back);
textFont(small);
textAlign(CENTER);
text(letters, 200, 220);
text(question, 200, 150);
if (mode == 0) {
println(0);
question = question;
}
if (mode == 1) {
println(1);
question = question1;
}
if (mode == 2) {
println(2);
question = question2;
}
if (mode == 3) {
println(3);
question = question3;
}
if (mode == 4) {
println(4);
question = question4;
}
if (mode == 5) {
println(5);
question = question5;
if ((keyPressed == true) && (key != ENTER)) {
text("?????????????", 200, 220);
}
}
if ((mode == 6) && (like == true)) {
question = question6;
println("6 like");
} else if ((mode == 6) && (like == false)){
question = question7;
println("6 hate");
}
if (mode > 8) {
question = haha;
}
if (mode == 7) {
question = "";
text("Either way...", 200, 150);
textFont (small);
text("Click mouse to try again -- Or not.", 200, 350);
}
}
void mousePressed() {
back = 102;
letters = "" ;
mode = 0;
question = "YES or NO...?";
}
void keyPressed() {
if ((key == ENTER) || (key == RETURN)) {
letters = letters.toLowerCase();
println(letters);
if (letters.equals("yes") || letters.equals("y.") ||
letters.equals("yes.") || letters.equals("y")) {
back = 0;
mode = mode + 1;
if (mode > 8) {
mode = 2;
}
}
else if (letters.equals("no") || letters.equals("n") ||
letters.equals("no.") || letters.equals("n.")) {
back = 104;
mode = mode +1;
if (mode == 2) {
like = false;
}
if (mode > 8) {
mode = 2;
}
}
else {
println("loook");
mode = 10;
}
letters = "";
}
else if ((key > 31) && (key != CODED)) {
letters = letters + key;
} else if ((key == DELETE) || (key == BACKSPACE) && (letters.length() > 0)) {
letters = letters.substring(0, letters.length()-1);
}
}Tiffany - G
on Monday, Oct 20, 2008 – 6:19 pm