Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void talkSmack() throws Exception {
- ArrayList<String> questions = new ArrayList<String>();
- ArrayList<String> ans = new ArrayList<String>();
- questions.add("Starting a band called 1023MB");
- ans.add("We'll never get a gig");
- questions.add("How did the hipster burn his tongue?");
- ans.add("He drank his coffee before it was cool");
- questions.add("What do you call someone with no body and a nose?");
- ans.add("Nobody Knows");
- questions.add("When I found out my toaster wasn't waterproof");
- ans.add("I was shocked");
- questions.add("What concert costs 45 cents?");
- ans.add("50 cent featuring nickelback");
- questions.add("How do you organize a party in space");
- ans.add("You planet");
- questions.add("How does moses make his tea");
- ans.add("Hebrews it");
- questions.add("Why did the can-crusher quit his job");
- ans.add("Because it was soda pressing");
- try {
- File joke = new File("joke.txt");
- FileReader fr = new FileReader(joke);
- BufferedReader br = new BufferedReader(fr);
- int a = Integer.parseInt(br.readLine());
- System.err.println(ans.get(a));
- fr.close();
- joke.delete();
- } catch (Exception e) {
- int a = (int)(Math.random()*questions.size());
- System.err.println(questions.get(a));
- FileWriter fw = new FileWriter(new File("joke.txt"),true);
- fw.write(a+"\n");
- fw.close();
- }
- }
Add Comment
Please, Sign In to add comment