
gameplay, various ship sizes and shapes, as well as the option to make. Welcome to the cosmic ShipCraft.
#Build a battleship online game zip
randint ( 0, dims - len_ship ) # Create list of column valuesĬol_ship = list ( range ( col, col + len_ship )) # Create positional values from row and column listsĬoords = tuple ( zip ( row_ship, col_ship )) else : # Same as above except switch column and rowĬol_ship = * len_ship row = random. Battleship (also Battleships or Sea Battle) is a guessing game for two players. iPhone Create your own Warship In 'Warship Craft', you create your own Warship with 3D and physics simulation, and have your Warship in an open water ocean warfare competing against others via Game Center. Row_ship = * len_ship # Randomly select column of first position of ship (Hence subtracting length of ship)Ĭol = random. If orientation = 0 : # Randomly select row and create list of selected row * length of ship randint ( 0, 1 ) # Ship is horizontal if orientation is 0 and vertical if orientation is 1

randint ( 2, dims ) orientation = random.


# Create and return ship positional coordinatesĭef build_ship ( dims ): # Length of ship is random number between 2 and length of board
