BattleShips with Python
$30-250 USD
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
ID do Projeto: #5314620
Sobre o projeto
6 freelancers estão ofertando em média $118 nesse trabalho
Hi ! I can make that game for you till 15.01.14. please contact me :) I am crazy about making every kind of games.