Question: def has _ ship [ fleet grid: list [ 1 ist [ str ] ] , fow _ start: int, col _ start: int, ship

def has_ship[fleet grid: list[1ist[str]], fow_start: int, col_start: int,
ship_syntol: str, ship_sizer int) bool:
wauneturn True if and only if a ship that (1) uses ship_symbol as its thip
symool and (2) has length ship_size appears in fleet onid starting at
position (row start, col_start), where (rou_start, col_start) is the
top-most/luft-most correr of the ship.
If the ship has ship_size z or more and appears as both a colum and a row,
return False.
Preconditions:
=1i(i,j)==1-8rleetrrid
 def has_ship[fleet grid: list[1ist[str]], fow_start: int, col_start: int, ship_syntol: str, ship_sizer

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!