Overall the exercise purpose is to practice the usage of the list, Battleship is a game where coordinates are said in order to take out your opponent which is good scenario for practice in the List usage. This is great for game design because it is the seed to different types of answers for different type of situations. upon making the list you needed to input raw inputs and many definitions within each other. Finally you were required to design the playing board itself.
once board is taking the argument of a list we make the map
printing
this is the format of the board
We join the rows and columns together
so in order to face an AI you need to make sure the numbers he picks for the coordinates are random so we import random. finally we code to make sure the random row gets a random x and the col gets a random y
so once the AI has determined its column we try to find it by being able for the player to think of the numbers. so we include some raw inputs.
To make sure we have a correct message to serve to the player we need to test out its answer. we program it so we know what the answers are,
we congratulate the player for being correct
Of course if the player misses we must tell them. We program it to have an else argument
We will get those players who go over the grid so we inform them of their actions
if repeats are said we must also tell the player (using past format)
we test the game
More turns need to be added to determine a winner.
once the turns are over a game over must come up to end the game
To end the game we must break the loop using “Break”
The final fully functional game