
The George Washington University
School of Engineering and Applied Science
Department of Computer Science
CSci 131 -- Algorithms and Data Structures I
Project #2
Due Date: beginning of class, Thursday, October 4, 2001
This project uses material from Section 8.3 of the CSci 51 book
This project continues Project 1 and gives you an opportunity to work
with random number generators.
In Project 1, a Knight's Tour is played with data received interactively
from a human user. In this part of Project 2, you will (1) complete the
Project 1 improvements (use of Screen package, XX icon)
if you haven't yet done so, and (2) develop a modified version of the Knight's
Tour program (based on a copy of your completed Project 1), that gives
the user the option of entering moves interactively or letting the computer
generate the moves.
-
If the user selects the first option, play the game just as in Project
1
-
If the user selects the second option, each move will be generated randomly,
then validated, then played as though it had been entered by the user.
-
The most straightforward approach to the random moves is to use two generators--one
for ranks, one for files--which are instantiated from the generic Ada.Numerics.Discrete_Random.
Section
8.3 of the CSci 51 book has a useful discussion and an example of using
this package.
-
In the second option, use the Screen package to present the progress
of the game. For example, use the bottom of the screen to present the latest
move and an indication of its validity, and show the move on the simulated
board. Consider using an appropriate DELAY statement to slow down
the action.
What to submit:
Submit your project in the form of a “Case Study” as described in Feldman/Koffman
and done in CSci 51. You may
attach this assignment sheet as a problem statement, then write the
Analysis, Design, Test Planning, Implementation,
and Testing sections, referring to this sheet where appropriate. Deliverables
should include:
Document for your analysis
Document for your algorithm with detailed
explanations.
Code -- a listing (.lsb) file (not a source
file!)
Document for your test plan
Test Results -- a printout (turnin script)
Grading:
Grading for this first project will be 0-20 points, as in CSci 51: Analysis/Design:
0-6, Test Plan: 0-4, Program Implementation 0-6, Code style and layout,
0-4.