Overview
--------
This program was originally written by David Buchwald and myself in 
Microsoft Windows using Microsoft Visual C++ and MFC.  It was written as a 
programming project for an object-oriented class at school.  I then ported 
the program to OS/2 and in the process rewrote a good portion of the 
application.

The original game is played on two separate plastic frames, each of which has 
a horizontal and a vertical playing surface.  The horizontal surface is used 
for both defensive ship placement and the marking of each of your opponents 
shots with white pegs to register a "miss" and red pegs to register a "hit". 
 The vertical surface is used for your offensive shots against your 
opponent.

Each player's fleet consists of 5 ships: aircraft carrier, destroyer, 
battleship, submarine, and a PT boat.  Each player distributes their fleet 
randomly around the horizontal surface.  A player then takes a "shot" by 
specifying a row and column location (i.e. a letter and number combination - 
A1 to J10).  The opponent then responds with "hit" or "miss" appropriately.  
When all the targets on a given ship are hit,  the ship is considered sunk.  
The player that sinks his opponent's entire fleet is the winner.

In this implementation, the left board is the human player's board and the 
right is the computer's. Each board consists of 100 individual squares in a 
10-by-10 matrix.  

Sound is provided via the OS/2 multimedia classes.  

The game is released as shareware and I hope you will enjoy it.

This game was developed using OS/2 Visual C++ compiler and the OpenClass 
class libraries.  


Starting the game
------------------
1. Unzip the file called BATTLE.ZIP into the directory of your choice.  This 
will create the necessary game files and a file called SOURCE.ZIP.  This file 
contains the source code needed to compile the game.

2. To begin the game,  type "battle" at the command prompt.  When the game 
begins,  click on game/new to start a new game.  If sound is not desired or 
you wish to change other parameters,  choose game/options first.



Playing the game 
------------------
When a new game starts, the human player will be prompted to arrange his or 
her ships on the board.  The player will do this by clicking the mouse button 
on any one of the 100 coordinates available in order to place the bow of the 
ship on the board. The player will then be prompted with directional indicators to 
select this ship's direction (N, S, E, W). The player will repeat this operation for 
the remaining ships, wait for the computer to place its ships, and then 
start the game.  The game will not allow overlapping ships.  

As previously 
mentioned, shots are taken by both players on their opponents respective 
boards.  The human player does this by selecting an opponent's coordinate 
with the left mouse button.  The computer selects the human player's 
coordinate automatically as if with the mouse.  If the shot is a miss, a 
bitmap of water will be displayed.  If the shot is a hit, a red dot 
bitmap will be displayed.  The first player to sink all the opponents 
ships wins the game.


Note
------
The system sounds might be disabled if you are currently running any 
DOS/Windows applications.  I found that on my machine if I simply closed the 
DOS-based application,  the sound worked just fine.  I had some problems with
the battleship bitmap changing colors on certain systems.  You are free to 
modify this bitmap in any way you choose.


Compiling the Source Code 
------------------------- 
The reason for submitting the source code was to 
provide more examples of using the IBM Class libraries for real-world 
applications.  I hope you find some useful examples of how to use the class 
libraries.  Maybe this will help spur other application development.

To compile the source,  unzip the SOURCE.ZIP file into the desired 
subdirectory and type "nmake /f battle.mak" at the command prompt.


Registration
------------
This product is released as Shareware.  If you like the product,  please 
register with the author by sending $5.00 to:

David Boudah
180 Cottage Road
Enfield, CT 06082
Compuserve ID -73163,3657
InterNet - dboudah@ibm.net


