coding project
Project detail
Your program is required to do the following:
# 1. Generate 2-dimensional game boards (minimum 10×10 and maximum 35×35).
# 2. Insert text strings within the 2D array (hidden from view).
# 3. Validate game coordinates within the 2D array.
# 4. Uncover individual characters at a specific location in the 2D array.
# 5. Keep track of the player’s score, last selection, and update the game board.
# Sample game boards (15×20 and 35×35) are displayed below
# Sample game boards are displayed below (first=15×20, second=35×35):
Python Battleship@Seneca…
123456789ABCDEFGHIJK
1|~~~~~~~~~~~~~~~~~~~~|
2|~~~~~~~~~~~~~~~~~~~~|
3|~~~~~~~~~~~~~~~~~~~~|
4|~~~~~~~~~~~~~~~~~~~~|
5|~~~~~~~~~~~~~~~~~~~~|
6|~~~~~~~~~~~~~~~~~~~~|
7|~~~~~~~~~~~~~~~~~~~~|
8|~~~~~~~~~~~~~~~~~~~~|
9|~~~~~~~~~~~~~~~~~~~~|
A|~~~~~~~~~~~~~~~~~~~~|
B|~~~~~~~~~~~~~~~~~~~~|
C|~~~~~~~~~~~~~~~~~~~~|
D|~~~~~~~~~~~~~~~~~~~~|
E|~~~~~~~~~~~~~~~~~~~~|
F|~~~~~~~~~~~~~~~~~~~~|
Current Score:000 Last Move: N/A
Python Battleship@Seneca…
123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
1|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
2|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
3|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
4|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
5|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
6|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
7|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
8|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
9|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
A|~~~~~~~~~~~~~~~~~~~~~~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
The game board dimensions will be supplied (minimum of
10 rows x 10 columns and maximum of 35 rows x 35 columns) such that
the rows and columns are to be labeled from 1 to 9 then from A to Z. The rows are
labeled on the left and the columns at the top.
The game board’s left and right boundaries are to be drawn using the ‘|’
character and the board contents itself drawn using only the ‘~’ character
(to indicate water ~ :-).
Your program will insert ship strings into the game board (2D array) starting at
specific locations and directions (hidden from view).
The ships themselves will not be displayed (of course), but must be tracked
internally. The program will then uncover the contents of the board one
coordinate at a time.
Points (5 points for each ship’s character uncovered) are awarded if the
coordinate (a Torpedo) uncovers one of the ship’s characters.
When this happens, that specific character and ALL characters in the
same row or column that it is connected to are uncovered (replacing
the ‘~’ with the actual letter in the ship’s string).
If a coordinate supplied does NOT uncover a ship character (Torpedo misses the target),
then the ‘~’ is replaced with the ‘X’ character for that coordinate.
After each coordinate that is sent, your program updates the Current Score,
and Last Move fields below the actual game board.
Your program will process 2-character coordinates to simulate “torpedo
launches” within the game board.