University of Virginia, Department of Computer Science
CS201J: Engineering Software, Fall 2002

Notes: Tuesday 26 November 2002
Schedule

Notes

What different kinds of abstraction have we seen in CS201J?





What is Computer Science?





What properties are necessary for a game to have a meaningful championship?





Measuring Networks

Latency — Time from sending a bit until it arrives seconds (or seconds per geographic distance)

Bandwidth — how much information can you transmit per time unit bits per second


Here is some code you may find useful for PS7:
import java.io.*;
import java.net.*;

public class MySnake extends SnakeInterface {
    ... 

    public MySnake (Socket s) throws IOException {
	super (s);	
	... 
    }

    public void updateState () {
	if (display != null) {
	    display.updateGrid ();
	}
    }

    static public void main (String args[]) {
	if (args.length != 2) 
	    {
		System.err.println ("Usage: java MySnake  ");
		System.exit (1);
	    } 
	else
	    {
		String server = args [0];
		int port = Integer.valueOf (args[1]).intValue ();

		try {
		    Socket s = new Socket (server, port);
		    MySnake ms = new MySnake (s);
		} catch (UnknownHostException e) {
		    System.err.println ("Cannot find host: "+ server);
		    System.exit (1);
		} catch (IOException e) {
		    System.err.println ("Unable to open connection to " + server + ": " + e);
		    System.exit (1);
		}
	    }
    }
}
Links

CS201J University of Virginia
Department of Computer Science
CS 201J: Engineering Software
Sponsored by the
National Science Foundation
cs201j-staff@cs.virginia.edu