EMPTY = '-'
def is_between(value, min_value, max_value):
" (number, number, number) -> bool
Precondition: min_value <= max_value
Return True if and only if value is between min_value and max_value,
or equal to one or both of them.
from battleship_functions import *
def generate_fleet_grid(grid_size, ships, sizes):
" (int, list of str, list of int) -> list of list of str
Return a new grid_size by grid_size fleet grid with the ship symbols
in ships and ship sizes in siz
import battleship_functions as bf
This code won't work until you've completed your functions in the
All functions called in here of the form bf.function_name are ones
that you will write.
# = Some functions t
# Use these constants in your code
MIN_SHIP_SIZE = 1
MAX_SHIP_SIZE = 10
MAX_GRID_SIZE = 10
UNKNOWN = '-'
EMPTY = '.'
HIT = 'X'
MISS = 'M'
" (file open for reading) -> list of list of objects
Return a list containing the ship
# Check for use of functions print and input.
our_print = print
our_input = input
raise Exception("You must not call print anywhere in your functions!")
raise Exception("You must not call