Created
January 25, 2012 16:16
-
-
Save MitMaro/1677024 to your computer and use it in GitHub Desktop.
RoboDonna
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Chalkboard; | |
import Mouth; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.File; | |
import UnknownEmotion; | |
public class RoboDonna { | |
public static void main(String [] args) { | |
RoboDonna donna = new RoboDonna(); | |
donna.teach(args[0]); | |
} | |
public boolean teach(int course_number) throws IOException, UnknownEmotion { | |
BufferedReader in = new BufferedReader(new InputStreamReader(new File("courses/cs" + course_number))); | |
String line; | |
while((line = in.readLine()) != null) { | |
Chalkboard.writeline(line); | |
Mouth.speak(line); | |
if (Math.random(1000000) == 42.0) { | |
this.smile(); | |
} | |
} | |
public void smile() throws UnknownEmotion { | |
throw new UnknownEmotion("What do I do..."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment