Hi! I'm trying to create my own battleship but i don't know where to start. I started using the codes from previous excersises and try to add more functions in it.
so I made multiple ships but how do you make them in different sizes and how do you make sure that the ships won't stack on each other?
This is my code so far.
board =  for x in range(8): board.append(["O"] * 8) def print_board(board): for row in board: print " ".join(row) print "Let's play Battleship!" print_board(board) def random_row_one(board): return randint(0, len(board) - 1) def random_col_one(board): return randint(0, len(board) - 1) def random_row_two(board): return randint(0, len(board) - 2) def random_col_two(board): return randint(0, len(board) - 2) ship_row_one = random_row_one(board) ship_col_one = random_col_one(board) ship_row_two = random_row_two(board) ship_col_two = random_col_two(board)