Skip to content
Snippets Groups Projects
Commit e04ce4d5 authored by W. Spencer Smith's avatar W. Spencer Smith
Browse files

Addition of initial drafts of remaining lectures and A4.

parent e440be5f
No related branches found
No related tags found
No related merge requests found
Showing
with 118 additions and 0 deletions
File added
\documentclass[12pt]{article}
\usepackage{graphicx}
\usepackage{paralist}
\usepackage{amsfonts}
\usepackage{hyperref}
\oddsidemargin 0mm
\evensidemargin 0mm
\textwidth 160mm
\textheight 200mm
\renewcommand\baselinestretch{1.0}
\pagestyle {plain}
\pagenumbering{arabic}
\newcounter{stepnum}
\title{Assignment 4}
\author{COMP SCI 2ME3, SFWR ENG 2AA4}
\begin {document}
\maketitle
The purpose of this assignment is to design and specify a module (or modules) to
store the state of a game of Battleship. The modules cover the Model portion of
the Model View Controller design pattern. The rules for Battleship can be found
at the following web-page:
~\newline
\href
{https://www.thespruce.com/how-to-play-battleship-411069}{https://www.thespruce.com/how-to-play-battleship-411069}
~\newline
Your assignment is to write a module that stores the state of the game board and
the status of the game. You do not need to worry about modules that display
graphics, or control the game play, or determine the strategies of a computer
opponent, etc.
Bonus marks are available for students that both implement and test their specification.
\section *{Deadlines}
\begin{itemize}
\item Specification: due 11:59 pm Apr 3
\item Code and Test Suite (Bonus): due 11:59 pm Apr 3
\end{itemize}
\section *{Step \refstepcounter{stepnum} \thestepnum}
Submit a report showing your design specification of the MIS for the game state
module. If your specification requires additional modules, you should include
their MISes as well. It is up to you to determine your modules interface; that
is, you decide on the exported constants, access programs, exceptions etc. You
also determine your state variables and specify the semantics for your access
program calls. When working on your design, you may want to consider the
following points:
\begin{itemize}
\item You probably want a game state for each of the two players. This would
make the module an abstract data type, not an abstract object.
\item The state of the game board with the battleships could be modelled as a two dimensional
sequence.
\item A separate board could be kept for each player to track the shots they
have taken.
\item You will need a routine to initialize the board.
\item You will need to be able to tell if the placement of a ship in the initial
configuration is valid or not.
\item You will need to be able to determine whether a shot is valid or not.
\item You will need to be able to inspect the state of any cell of the game
board.
\item You will need to be able to tell when a ship has been sunk.
\item You need to be able to tell when the game is over.
\end{itemize}
\section *{Bonus Step \refstepcounter{stepnum} \thestepnum}
Submit Java or Python code that matches the specification given in the previous
step. You should also submit code that tests your module(s) using PyUnit or
JUnit. You are free to document your source code as you see fit. That is, you
can use doxygen, javadoc or pydoc, or you can use regular code comments. You
code should include a makefile, with rules \texttt{make test} and \texttt{make
doc} (if appropriate).
\noindent Your submission of code and test cases should be to our git repo.
\subsubsection*{Notes}
\begin{enumerate}
\item Your git repo is organized with the following directories at the
top level: {\tt A1}, {\tt A2}, {\tt A3}, and {\tt A4}.
\item Inside the {\tt A4} folder you will start with initial stubs of the files
and folders that you need to use. Please do not change the names or locations
of any of these files or folders. The structure of your project files and
folders should look like this:
\begin{itemize}
\item A4
\begin{itemize}
\item[$*$] Makefile
\item report
\begin{itemize}
\item report.tex
\item report.pdf
\end{itemize}
\item src
\end{itemize}
\end{itemize}
\item Please put your name and macid at the top of each of your source
files.
\item Your program must work in the ITB labs on mills.
\item \textbf{Any changes to the assignment specification will be announced in
class. It is your responsibility to be aware of these changes. Please
monitor all pushes to the course git repo.}
\end{enumerate}
\end {document}
\ No newline at end of file
File added
Lectures/Figures/CompleteCoveragePrinciple.png

35.5 KiB

File added
Lectures/Figures/ControlGraphRules.png

30.5 KiB

File added
Lectures/Figures/EuclidsAlgorithm.png

27 KiB

File added
Lectures/Figures/Example.png

3.88 KiB

File added
Lectures/Figures/ExampleStatementCoverage.png

29.7 KiB

File added
Lectures/Figures/FunctionTableTesting.png

12.7 KiB

File added
Lectures/Figures/Inheritance.png

13.3 KiB

File added
Lectures/Figures/Simplification.png

10.3 KiB

File added
Lectures/Figures/TestingAFunctModule.png

14.7 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment