Question: PROGRAMMING - Language is SWIFT Create a command line program (code) written in Swift to play Battleship. Play of Game At the start of the

PROGRAMMING - Language is SWIFT

Create a command line program (code) written in Swift to play Battleship.

Play of Game

At the start of the game display a welcome message: "Welcome to Command Line Battleship"

The program should place five ships, the placement locations can be hard coded. Ships can be one of three different types: tug boat (3 on board), submarine (1 on board) or air craft carrier (1 on board). The ships are different sizes tug boat is two characters, submarine is three characters and air craft carrier is four. The ship characters are as follows (if you cant find these characters in the Unicode set use something similar): - submarine: cyrillic capital letter marred - air craft carrier: cyrillic capital letter Sha - tug boat: cyrillic capital letter zhe with diaeresis

Each of these ships should be placed in a grid in either horizontal or vertical direction without overlapping each other. The object of the game is to find all five ships. Initially the grid is displayed with * representing each position in the grid. The rows should be marked by letters of the alphabet and the columns should be represented by numbers. The initial grid should look like this:

PROGRAMMING - Language is SWIFT Create a command line program (code) written

| 1 2 3 4 5 6 7 8 9 10 A * * * B* * * C* * D * * * * E * * F * * G * * * * H* * * * I * * J * * * * * *

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!