Question
need help using only python and not importing anything Using the algorithm for the Arrays assignment. Create a 3D Battle ship program making use of
need help
using only python and not importing anything
Using the algorithm for the Arrays assignment. Create a 3D Battle ship program making use of a 3 dimensional array.
There will me 5 ships that will be hidden anywhere on each level.
The board will be 3 X 12 X 12
Randomly generate each hiding space for each ship.
A ship can only be on one level
A ship size will denote the number of elements it takes up.
Ship 1 = 2
Ship 2 = 3
Ship 3 = 3
Ship 4 = 4
Ship 5 = 5
After hiding the ships, allow the user to guess where the boats are one element at a a time
Mark the found elements on the two dimensional table to show progress.
Give the user a limit to the amount of guesses made.
-you can modified the code that i have here
level = [[[' ' for c in range(3)] for r in range(3)] for l in range(3)]
for l in range (3): print ("level", l+1) for r in range (3) : for c in range (3) : level [l] [r] [c] = 'A' + str (l)+","+ 'B' + str (r)+","+ 'C' + str (c) print (level[l][r][c], end = ' ') print ()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started