BattleShips with Python

Concluído Postado Jan 13, 2014 Pago na entrega
Concluído Pago na entrega

Battleships is a 2 players, 10x10 table based war game in which every player tries to shoot one another's ship.

Each player has the following setup:

- 1 Flagship (battle cruiser) takes up 5x rooms)

- 1 Minelayer ( takes up 2x rooms)

- 1 Destroyer ( takes up 4x rooms)

- 1 Frigate (takes up 3x rooms )

- 1 Submarine (takes up 3x rooms)

After each shot, shooting spot can be denoted by 2 different symbols 'X' and '*' (star).

The symbol "X" represents "miss", while "*" represents successful hit.

If the hit is successful, the player will keep shooting until he misses. When a shot is missed, other player takes the turn.

Game goes on until the one of the opponents has lost all of their ships.

It is not allowed to shoot at the same point twice, and it is also forbidden to change the spots of the ships during shooting.

The program will:

1. Place the ships that mentioned above, randomly on 10x10 matrix.

2. Coordinates of the ships must be unique, they should not collide.

3. User guesses must be in numbers between 1-10 and letters between A-J

- Enter your guess: 3A

- Enter your guess: 8L

Error: Invalid coordinates

4. If a ship gets hit, the program should output a message stating that a ship is hit or sunk. (ie. Submarine is hit, frigate is sunk etc)

5. Program should report to user after each shooting.

6. Program should terminate if the 'q' is pressed.

7. Program should report if the 'r' is pressed.

Sample report:

- You have made 22 shooting attempts.

- 1 Flagship ( + + + + + )

- 1 Minelayer ( + + )

- 1 Destroyer ( + + - - ) casualty

- 1 Frigate ( + - - ) casualty

- 1 Submarine ( - - - ) sunk

Sample run:

Enter your guess: 3B

[3B] Iska

A B C D E F G H I J

1 O O O O O O O O O O

2 O O O O O O O O O O

3 O X O O O O O O O O

4 O O O O O O O O O O

5 O O O O O O O O O O

6 O O O O O O O O O O

7 O O O O O O O O O O

8 O O O O O O O O O O

9 O O O O O O O O O O

10 O O O O O O O O O O

Enter your guess: 4E

[4E] Destroyer is hit

A B C D E F G H I J

1 O O O O O O O O O O

2 O O O O O O O O O O

3 O X O O O O O O O O

4 O O O * O O O O O O

5 O O O O O O O O O O

6 O O O O O O O O O O

7 O O O O O O O O O O

8 O O O O O O O O O O

9 O O O O O O O O O O

10O O O O O O O O O O

Enter your guess ? 4F

[4F]Destroyer is hit

A B C D E F G H I J

1 O O O O O O O O O O

2 O O O O O O O O O O

3 O X O O O O O O O O

4 O O O * * O O O O O

5 O O O O O O O O O O

6 O O O O O O O O O O

7 O O O O O O O O O O

8 O O O O O O O O O O

9 O O O O O O O O O O

10O O O O O O O O O O

Enter your guess ? 4F

You have made that move before. Please make another move.

Enter your guess ?

Deadline for the job is: 15th of January , 18:00 (GMT + 4)

Kind regards,

Jeremy

Matemática Python

ID do Projeto: #5314620

Sobre o projeto

6 propostas Projeto remoto Ativo em Jan 13, 2014

Concedido a:

slbonny

Hello, I've written a C code for battleship game while I was in my freshman year, and it was a human-vs-computer game. So I am totally clear about the game logic, and I can guarantee to fulfil each of the requiremen Mais

$88 USD em 1 dia
(0 Comentários)
2.8

6 freelancers estão ofertando em média $118 nesse trabalho

SMurcielago

A proposal has not yet been provided

$100 USD em 1 dia
(12 Comentários)
4.2
it2051229

Hi, I am placing my bid on your project because I have read the requirements and I am confident enough with my Python and algorithm skills. I am focused mostly on doing computer science homework here in freelancer.com Mais

$30 USD em 1 dia
(4 Comentários)
2.9
urmate

HI Contact me for an efficient, well documented and perfect solution and development of your project. I ensure quality work with always on time delivery of project and dedicated support and follow up. Than Mais

$75 USD em 1 dia
(1 Comentário)
2.0
ARIS11

Add My Skype id--lalagal4 please add more discuss hire me----https://www.freelancer.com/u/ARIS11.html Honey Sir, We would pair to get this possibleness of working with you. We can indorse that you gift not rue your Mais

$30 USD in 2 dias
(0 Comentários)
0.0
macfij7

Hi ! I can make that game for you till 15.01.14. please contact me :) I am crazy about making every kind of games.

$133 USD in 2 dias
(0 Comentários)
0.0