Battleship Guide

Battleship-Guide

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 21

Sam Haskins
November 28th, 2018
Submitted to: Nikos Rentas
Course code: ICS4U
Battleship User Guide
Table of Contents
Introduction 4
Loading Instructions 4
Procedure 1: Launching Battleship using a Shortcut 4
Procedure 2: Launching Battleship’s Java Archive 6
Using Battleship’s Features 7
Select Type of Game 7
Description 7
Procedure 3: Select Type of Game 7
Sample Input 8
Sample Output 8
The Battleship Boards 8
Figure 1: The Battleship Boards (Game Start) 9
Figure 2: The Battleship Boards (Game End) 9
Place Ship 10
Description 10
Table 1: Types of Ships 10
Procedure 4: Place Ship 11
Table 2: Place Ship Sample Input 12
Table 3: Place Ship Sample Output 13
Fire 13
Description 13
Procedure 5: Fire 14
Table 4: Fire Sample Input 15
Table 5: Fire Sample Output 16
Start New Game 17
Description 17
Procedure 6: Start New Game 17
Sample Input 17
Sample Output 17
About 18
Description 18
Procedure 7: About Battleship 18
Sample Input 19
Sample Output 19
2
Rotate Menu 19
Exit 19
Description 19
Procedure 8: Exit 19
Sample Input 20
Sample Output 20
References 21
 
3
Introduction
The purpose of this document is to familiarize the user with the operation of the
Battleship software project. Battleship is a software simulation of a popular board
game, also called Battleship. Its purpose is to entertain a user, providing all the fun
of the original Battleship game, even when the board game is not available. This
makes it especially suited to situations such as meetings and waiting for airplanes.
Battleship is supported on any platform that supports the Java Standard Edition
10.0.2 Runtime Environment, including support for the Swing Application
Programming Interface.
Battleship was analyzed, designed, and implemented by Sam Haskins, a high school
student residing in Ottawa, Ontario, Canada.
The most recent version of Battleship, 1.0.1, was released on November 27th, 2018,
with two future releases anticipated.
Loading Instructions
Battleship may be loaded via clicking a provided shortcut or via launching the
Battleship Java Archive directly. The first method, using a shortcut, is only available
on platforms on which Battleship was installed using the Windows Installer method.
For more details, consult Battleship’s Installation Instructions. Procedures for both
methods are provided in this section.
Procedure 1: Launching Battleship using a Shortcut
Text Instructions
Visual Instructions
1) Ensure that Battleship was installed
on the platform using the Windows
Installer method. If it was not, this
procedure cannot be used.
For more details, consult the Battleship
Installation Instructions.
(Berg, 2015)
4
2) Double click the start menu or
desktop shortcut. Both shortcuts work;
it is recommended to use whichever is
more convenient.
3) Battleship will start.
The procedure is complete.
 
5
Procedure 2: Launching Battleship’s Java Archive
Text Instructions
Visual Instructions
1) Locate the “Battleship.jar” file in the
directory where Battleship was
installed.
For more information, consult the
Battleship Installation Instructions.
(Dodd)
2) Invoke the “Battleship.jar” file.
On Windows platforms, this is
accomplished via two clicks in rapid
succession. This is referred to as a
“double-click”.
3) Battleship will start.
The procedure is complete.
 
6
Using Battleship’s Features
This section of the User Guide describes Battleship’s features and the procedures
for using them. Before utilizing any of Battleship’s features, the Battleship
application must be launched; to do this, consult the previous section.
Select Type of Game
Description
The Select Type of Game dialog allows the user to select a game against the AI, or a
two-player game.
Procedure 3: Select Type of Game
Text Instructions
Visual Instructions
1) To reach the “Select Type of Game”
dialog, invoke the “Battleship > Select
game type” menu entry.
The dialog will also be shown when
Battleship is first run.
2) Enter the desired selection using the
provided radio buttons.
7
3) Click the “Select” button when
complete.
Sample Input
Sample input for the “Select Type of Game” dialog is “Game against the AI” or
“Two-player game.”
Sample Output
Sample output for the “Select Type of Game” dialog is a game against the Battleship
AI or a two-player game.
The Battleship Boards
The Battleship Boards are the main component of Battleship’s Graphical User
Interface. A board is displayed for each player, including the AI if necessary. Two
features of Battleship, placing a ship and firing, are exposed through the Battleship
Boards.
8
Figure 1: The Battleship Boards (Game Start)
An annotated image of the Battleship Boards, describing the association of players
to a board.
Figure 2: The Battleship Boards (Game End)
Red squares are hit ships; Grey squares are hit yet empty.
9
Place Ship
Description
Placing ships is an important feature within the Battleship software project. To
place a ship, click on the Battleship Board at the desired position. This can only be
done on the board belonging to the current player. For example, on Player 1’s turn,
click on the first Battleship Board. Ships are always placed in the sequence of
Aircraft Carrier, then Battleship, then Cruiser, then Submarine, then Destroyer.
Table 1: Types of Ships
This table contains information about the types of ships available in Battleship. It is
organized by the order in which they are placed.
Name
Image
Aircraft Carrier
Battleship
Cruiser
Submarine
10
Destroyer
Procedure 4: Place Ship
Text Instructions
Visual Instructions
1) Rotate the ship to the desired
position using the keys “a” and “d” or
the menu items “Rotate > Forward” and
“Rotate > Backward”.
2) Place the ship at the desired position
by clicking on the desired grid square.
Hovering the cursor will preview the
ship’s placement.
If the placement succeeds, the other
player will subsequently be allowed to
place a ship.
3) If the previous step did not succeed,
go to step 2. Otherwise, the procedure
is complete.
The ship has been placed.
(Ciciliano, 2018)
 
11
Table 2: Place Ship Sample Input
Description
Image
Player 1 placing an Aircraft Carrier with
the default rotation at E-5.
Player 1 placing a rotated Submarine at
H-10.
Player 2 placing a Destroyer with the
default rotation at F-5.
 
12
Table 3: Place Ship Sample Output
Description
Image
Player 1 placed an Aircraft Carrier with
the default rotation at E-5.
Player 1 placed a rotated Submarine at
H-10.
Player 2 placed a Destroyer with the
default rotation at F-5.
Fire
Description
The “fire” feature of Battleship allows a player to fire at their opponent’s board,
once on each turn. This feature can only be initiated if it is the initiating player’s
turn. To fire, click on the desired cell on the opponent’s board. After firing, the
player’s turn ends and control is passed to the other player.
 
13
Procedure 5: Fire
Text Instructions
Visual Instructions
1) Click on the cell to be fired upon.
This cell must be on the opponent’s
board.
2) If the cell fired upon had a ship in it,
it will be colored red.
Otherwise, it will be colored grey.
14
3) If the game has not been won,
control passes to the other player.
The procedure is complete.
Table 4: Fire Sample Input
Description
Image
Player 1 firing on A-4.
Player 1 firing on J-5.
Player 2 firing on F-9.
 
15
Table 5: Fire Sample Output
Description
Image
Player 1 fired on A-4, but it was not a
hit.
Player 1 fired on J-5; it hit a ship.
Player 2 fired on F-9; it hit a ship.
16
Start New Game
Description
The Start New Game feature of Battleship allows the user to start a new game of
Battleship against the previously-selected opponent. For information on selecting
an opponent, consult the “Select Type of Game” section of Battleship’s User Guide.
Procedure 6: Start New Game
Text Instructions
Visual Instructions
1) Invoke the “Battleship > Start new
game” menu entry.
2) A new game of Battleship will be
started against the previously-selected
opponent.
The procedure is complete.
Sample Input
Sample inputs for the “Start New Game” feature include: start new game with an AI
opponent selected, and start new game with a two-player game selected.
Sample Output
Samples outputs for the “Start New Game” feature include: a new game against an
AI opponent, and a new two-player game.
17
About
Description
To find information about Battleship and the environment upon which it is running,
use the “About” feature. This feature displays information about Battleship,
Battleship’s version, the version of the Java platform, and the operating system’s
architecture and version. To use this feature, consult procedure 7.
Procedure 7: About Battleship
Text Instructions
Visual Instructions
1) To open the “About” dialog, invoke
the “Help > About” menu item.
2) The about dialog will open, displaying
information about Battleship and the
platform.
3) To close the about dialog, click the
“Close” button.
18
Sample Input
Sample input for the “About” feature is limited to invoking the “Help > About” menu
item.
Sample Output
The “About” feature will open the about dialog, displaying information about
Battleship and the platform.
Rotate Menu
Battleship contains a “Rotate” menu. This menu can be used to rotate ships during
ship placement. For more information, consult Procedure 4: Place Ship.
Exit
Description
Battleship contains an “Exit” menu item. This item, when invoked, exits the
program. The operation of this feature is detailed in this section of the Battleship
User Guide.
Procedure 8: Exit
Text Instructions
Visual Instructions
1) To exit Battleship, invoke the
“Battleship > Exit” menu item.
Alternatively, the exit button provided
by the platform’s window manager may
be invoked with the same effect.
2) Battleship will exit immediately.
The procedure is complete.
(Gothelf, 2016)
19
Sample Input
Sample inputs for the “Exit” feature include clicking the menu item “Battleship >
Exit” and clicking a platform window-manager defined close button.
Sample Output
The output of the “Exit” feature is Battleship immediately exiting.
20
References
Berg, M. (2015, April 21). HDFootageStock. Young, handsome man sitting behind the
desk. Retrieved November 27, 2018, from
http://hdfootagestock.com/video/9675974/young-handsome-man-sitting-beh
ind-the-desk-he-is-reading-notes-and-getting-angry-because-of-what-he-sees
-he-is-throwing-away-notes-and-looking-into-his-phone
Ciciliano, L. (2018, April 3). SEO For Lawyers. Switching A Law Firm To Linux. Retrieved
November 27, 2018, from
http://www.seo-for-lawyers.com/switching-your-law-firm-to-linux-series-wrap
-up/
Dodd, A. (n.d.). Lyon County Schools. Windows 7 Tips and Tricks. Retrieved November
27, 2018, from
http://www.lyon.kyschools.us/docs/district/depts/2/windows%207%20tips%2
0&%20tricks.pdf?id=88
Gothelf, A. (2016, July 25). Salesforce. 3 Ways To Free Yourself from Your Desk.
Retrieved November 28, 2018, from
http://www.salesforce.com/blog/2016/07/3-ways-to-free-yourself-from-your-
desk.html
21

Navigation menu