Python: Building battleship code