Battleships game core written in python