\documentclass[12pt]{article}
\usepackage{vmargin}
\setpapersize{USletter}
\setmarginsrb{1.1in}{1.0in}{1.1in}{0.6in}{0.3in}{0.3in}{0.0in}{0.2in}
\parindent 0in  \setlength{\parindent}{0in}  \setlength{\parskip}{1ex}

%\usepackage{palatino}
\usepackage{times,mathptm}
\pagestyle{myheadings}
\markright{\footnotesize CS 451 Programming Paradigms, Spring 2002}


\begin{document}

\setcounter{section}{2}
\section*{Homework 2 --- Squeak --- due Monday 11 February}

Total number of points available on this homework is 200. Full credit
is equivalent to 100 points.

\subsection{Chemotaxis in Escherichia coli (70pts)}

The problem is explained on the following web page as an assignment in Scheme:\\
\texttt{http://www.cs.unm.edu/\~{}williams/cs257/ecoli/ecoli.html}.
In brief, you are going to write a program which draws the 
trajectory of an \emph{E. coli} bacterium
looking for food. 

Construct a Squeak class for bacteria and a Squeak class for food,
including methods to draw themselves (with or without
leaving a trail), then run a simulation to produce a drawing as
in the Scheme assignment.

\subsection{More chemotaxis (30pts)}
Do the same with multiple bacteria present and moving at the same time,
and leaving trails of different colors.

\subsection{Extra credit --- More chemotaxis (20pts)}
Create a subclass of food that is capable of motion and repeat the
exercise with the food now moving. Test with periodic regular motion
and with Brownian motion.

\subsection{Extra credit --- More Scheme (40pts)}
In Exercise 4 of Homework 1, you built maximum safe subsets (of strings
over an alphabet, a safe Hamming distance apart pairwise).
Find a maximum safe subset for the alphabet $\{A,G,C,T\}$,
for string lengths $N = 12, 13, 14, 15, 16, 17, 18, 28, 29, 30, 31, 32$ 
and minimum Hamming distances $D = 3, 4, 5, 6, 7, 8, 9, 10$.

\subsection{Extra credit --- More Scheme (20pts)}
Write a Scheme program that plays tic-tac-toe against a human opponent,
and is guaranteed not to lose.

\subsection{Extra credit --- More Squeak (20pts)}
Write a Squeak program that plays tic-tac-toe against a human opponent,
and is guaranteed not to lose.

\subsection*{How to turn in}

Turn in your code by running 

 \emph{\char126dmykola/handin your-file}

on a regular UNM CS machine. 

You should use whatever filename is appropriate in place of your-file. 
You can put multiple files on the command line, or even directories. Directories will have their entire contents handed in, so please be sure to clean out any cruft.

Special considerations for Squeak: 

For each exercise, write a class method \textsf{testIt} that does all
the work necessary. In the header of the method write a comment
such as \textsf{"TicTacToe testIt."}.

Please do not turn in an entire directory
with Squeak images---it would be too big. Instead, group all the classes
you have created into a single class 
category, called \textsf{CS451HW2}, and
file out. Then submit the file \texttt{CS451HW2.st}.

Thus, the grader will start a fresh Squeak, 
file in the file \texttt{CS451HW2.st},
open a system browser,
find the category \textsf{CS451HW2},
and for each of the exercise classes, 
find its class method \textsf{testIt},
highlight the text in the comment, such as \textsf{"TicTacToe testIt."},
and then \textsf{doIt}.

\end{document}

