// APS101, Winter 2009: Lecture 31 (Mar. 26) // // Review: last time we wrote a "driver" for our Tic-Tac-Toe game. // Running a Java program from the command-line (ex. a Linux terminal window): // "javac" compiles the .java source file into a .class file, which is in bytecode language. javac TTTDriver.java // then, you can "run" a class that has a main method: java ClassName (without the .class extension) java TTTDriver // as you can see, we can write code in any editor, compile it, and run it // from the command-line without DrJava! // let's process arguments in TTTDriver (like who plays first) java TTTDriver O java TTTDriver X // what's the problem here, and how did we "fix" it? java TTTDriver F java TTTDriver 55 // what do you think happens here? java TTTDriver abc xyz // we want the program to not run if the number of arguments is incorrect. // now, let's write a text driver (no GUI): java TTTTextDriver // (watch out for IOExeptions when working with Input/Output!) // we don't care about the list of args in the TextDriver: java TTTTextDriver abc def xyz 555 // exercise: transposing a 2-D square matrix // (complete Matrix.java)