B 12 I ks91@sfc.wide.ad.jp N208 8/7/2003 13:21 p.1/64
/ ( ) 8/7/2003 13:21 p.2/64
8/7/2003 13:21 p.3/64
2! 12 7/ 8 1 13 7/15 2 / ( ) 11 (SFC ) ( 5 ) 8/7/2003 13:21 p.4/64
10 2003/7/22 23:59 JST 11 ( ) 12 ( ) 2003/7/31 23:59 JST 12 11 12 11= 12= ( ) 11! 8/7/2003 13:21 p.5/64
/ ( ) 8/7/2003 13:21 p.6/64
8/7/2003 13:21 p.7/64
8/7/2003 13:21 p.8/64
p o 8/7/2003 13:21 p.9/64
p o 8/7/2003 13:21 p.10/64
p 8/7/2003 13:21 p.11/64
p o (S0) (S1) (S2) S1?? S1/S2?? S1/S2?? 0?? S1 8/7/2003 13:21 p.12/64
p o (S0) (S1) (S2) S1 S1/S2 S2 S1/S2 0 0 S1 S1 8/7/2003 13:21 p.13/64
p o 8/7/2003 13:21 p.14/64
... 8/7/2003 13:21 p.15/64
8/7/2003 13:21 p.16/64
p o 8/7/2003 13:21 p.17/64
p o 8/7/2003 13:21 p.18/64
p 8/7/2003 13:21 p.19/64
p o (S0) 0 (S1) 1 (S2) (S3) S1 1 S2 S1/S3???????? S1???????? S0 8/7/2003 13:21 p.20/64
p o (S0) 0 (S1) 1 (S2) (S3) S1 1 S2 S1/S3 S1 S1 S1 S0 S0 S0 8/7/2003 13:21 p.21/64
p o 8/7/2003 13:21 p.22/64
8/7/2003 13:21 p.23/64
p o 8/7/2003 13:21 p.24/64
p o (S0) (S1) (S2) (S3) S1 S2 S2 S1 S2 8/7/2003 13:21 p.25/64
p o GUI ( ) ActionListener actionperformed() 8/7/2003 13:21 p.26/64
p o CLI ( ) ( quit ) 8/7/2003 13:21 p.27/64
j 8/7/2003 13:21 p.28/64
j o (1) class NervousBreakDown implements ActionListener { public NervousBreakDown() { } public void actionlistener(actionevent event) { : } private void () { : } private Card[] aocards; private JPanel panel; : private int state; } 8/7/2003 13:21 p.29/64
j o (2) public void actionlistener(actionevent event) { } if ( ) { 1 if ( state == 0 ) { 1 state = 1 } else if ( state == 1 ) { 2 } } else if ( ) { } else if ( ) { 2! 2 } : 8/7/2003 13:21 p.30/64
j o (1) class Card extends JButton { public Card( ) {} public int getstate() { return ( state); } public redo() {} ( ) public relocate( ) {} public remove() {} ( ) } public select() {} ( ) private int state; private ImageIcon iconfront; private static ImageIcon iconback; private static ImageIcon iconnone; 8/7/2003 13:21 p.31/64
j o (2) class Card extends JButton { : public select() { if ( state == ) { seticon( iconfront); } : } state = ; } 8/7/2003 13:21 p.32/64
/ ( ) 8/7/2003 13:21 p.33/64
/ Random Date/SimpleDateFormat Timer JButton/ImageIcon 8/7/2003 13:21 p.34/64
j o All-in-one jar ( slot-machine.jar) z:> java -jar slot-machine.jar z:> jar xvf slot-machine.jar SlotMachine.java 8/7/2003 13:21 p.35/64
j SlotMachine o ( ) ( ) ( ) 8/7/2003 13:21 p.36/64
j SlotMachine o Random ( ) Date/SimpleDateFormat ( ) Timer ( ) JButton/ImageIcon ( ) 8/7/2003 13:21 p.37/64
8/7/2003 13:21 p.38/64
j java.util.random Random(long seed) seed: int nextint() 8/7/2003 13:21 p.39/64
j Random random = new Random(System.currentTimeMillis()); ( ) : int irandom = random.nextint(); System.currentTimeMillis() 1970 1 1 00:00:00 GMT nextint() 8/7/2003 13:21 p.40/64
j Random o : int irandom = random.nextint(); selected = [Math.abs(iRandom) %.length]; (Math.abs() ) : ( ) 32... 1 1 32 3 3 32 8/7/2003 13:21 p.41/64
j java.text o.simpledateformat SimpleDateFormat(String pattern) pattern: ( : HH:mm:ss ( : : )) String format(date date) date 8/7/2003 13:21 p.42/64
j java.util.date Date(long date) date: 1970 1 1 00:00:00 GMT System.currentTimeMillis() 8/7/2003 13:21 p.43/64
j SimpleDateFormat/Date o : format = new SimpleDateFormat( HH:mm:ss ); : : time = new Date(System.currentTimeMillis()); String s = format.format( time); : : _format GMT SlotMachine.java 8/7/2003 13:21 p.44/64
j javax.swing.timer Timer(int delay, ActionListener listener) delay: ( : ) listener: void start() void stop() 8/7/2003 13:21 p.45/64
j Timer class implements ActionListener { : : : timer = new Timer(1000, this); 1 timer.start(); 1 public void actionperformed(actionevent event) { Object source = event.getsource(); if (source == timer) { : 1 Timer actionperformed() 8/7/2003 13:21 p.46/64
j javax.swing.jbutton Swing JButton(Icon icon) icon: void addactionlistener(actionlistener l) l void seticon(icon icon) 8/7/2003 13:21 p.47/64
j javax.swing.imageicon Icon ImageIcon(String filename) filename: ImageIcon(URL location) location: 8/7/2003 13:21 p.48/64
j JButton/ImageIcon o class implements ActionListener { : : icon = new ImageIcon( getclass().getresource( )); getclass().getresource() jar button = new JButton( icon); button.addactionlistener(this); public void actionperformed(actionevent event) { Object source = event.getsource(); if (source == button) { button.seticon( ); : 8/7/2003 13:21 p.49/64
j MouseListener ( ) java.awt.event.mouselistener SlotMachine.java 8/7/2003 13:21 p.50/64
/ ( ) 8/7/2003 13:21 p.51/64
a a 8/7/2003 13:21 p.52/64
j INU o All-in-one jar ( inucalc.jar) z:> java -jar inucalc.jar z:> jar xvf inucalc.jar InuCalc.java 8/7/2003 13:21 p.53/64
j INU o Command Line Interface CLI z:> java -jar inucalc.jar -cli quit 8/7/2003 13:21 p.54/64
j InuCalc o BufferedReader/InputStreamReader ( ) CLI... public, private protected protected 8/7/2003 13:21 p.55/64
j java.io.bufferedreader BufferedReader(Reader in) in: String readline() 1 8/7/2003 13:21 p.56/64
j java.io o.inputstreamreader InputStreamReader(InputStream in) in: System.in 8/7/2003 13:21 p.57/64
j java.io.fileinputstream System.in InputStreamReader FileInputStream(String name) name: 8/7/2003 13:21 p.58/64
j o : BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); System.out.print( ); try { String s = reader.readline(); 1 } catch (IOException unused) { } : 8/7/2003 13:21 p.59/64
/ ( ) 8/7/2003 13:21 p.60/64
( ) All-in-one jar 8/7/2003 13:21 p.61/64
j All-in-one jar o All-in-one jar -jar java SOI 8/7/2003 13:21 p.62/64
j All-in-one jar o -jar jar manifest.txt Main-Class: z:>jar cvfm manifest.txt *.class *.java c( ) v ( ) f ( ) m ( ) 8/7/2003 13:21 p.63/64
8/7/2003 13:21 p.64/64