Advertisement
rtcv

batalhanaval-py

Jan 27th, 2022
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.69 KB | None | 0 0
  1. import sys
  2. import math
  3. from BattleShipLibrary import BattleShip
  4. import random
  5.  
  6. #Não Remover
  7. BattleShip = BattleShip()
  8.  
  9. #Este é o BattleShip
  10. #Seu objetivo é atingir a maior quantidade de barcos do seu rival
  11. #Você e seu oponente possuem uma maxtrix 10x10 cada, as embarções são distribuidas aleatoriamente na maxtrix
  12. #Para realizar um disparo utilize a função BattleShip.Fire(0,1), passando a coordenada X,Y que vão de 0 à 9.
  13. #A função retorar um valor boleano (true ou false), sendo true ao acertar e false ao errar
  14.  
  15. #Exemplo:
  16. #Esta instrução disparo um tiro na linha 1 na posição 5
  17. for _ in range(100):
  18.     resp = BattleShip.Fire(random.randrange(0, 9), random.randrange(0, 9))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement