Skip to content

Instantly share code, notes, and snippets.

@ducc
Created May 7, 2017 19:51
Show Gist options
  • Save ducc/ff6e158d1e99e9ce57c34bb60a8d2dc8 to your computer and use it in GitHub Desktop.
Save ducc/ff6e158d1e99e9ce57c34bb60a8d2dc8 to your computer and use it in GitHub Desktop.
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Dab {
private enum State {
DO_YOU_LIKE_TO_DAB, HOW_OFTEN_DO_YOU_DAB, END
}
public static void main(String[] args) {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
State state = State.DO_YOU_LIKE_TO_DAB;
System.out.println("do you like to dab?");
String line;
while (((line = reader.readLine()) != null) && state != State.END) {
switch (state) {
case State.DO_YOU_LIKE_TO_DAB:
if (line.equals("yes")) {
System.out.println("how often do you dab");
state = State.HOW_OFTEN_DO_YOU_DAB;
} else {
System.out.println("Fuck U dr");
state = State.END;
}
break;
case State.HOW_OFTEN_DO_YOU_DAB:
if (line.equals("a lot lol")) {
System.out.println("woooooooooo!!!!!!!!!!!!!!!!!")
} else {
System.out.println("oh");
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment