- By Emmanuel Valverde
- ·
- Posted Jan 28, 2023 9:00:00 AM
Shopping cart
What do we want to build? We are building a shopping cart for an online grocery shop. The idea of this kata is to build the product in an iterative..
This version of the classic game has three ships:
Create a program that allows the user to specify commands for playing battleship. The commands available are:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
0| | | | | | | | | | |
1| | | | | | | | | | |
2| | | | | | | | g | | |
3| | | d | d | d | | | | | |
4| | | | | | | g | | c | |
5| | | | | | | | | c | |
6| | | | | | | | | c | |
7| | g | | | | d | | | c | |
8| | | | | | d | | | | |
9| | | | | | d | | | | g |
Using Exhibit A above, here is a battle report based on the ship positions:
[ Player1
Total shots: 23
Misses: 15
Hits: 8
Ships Sunk: [
Gunship: (1,7),
Gunship: (9,9),
Gunship: (7, 2),
Destroyer (2,3) ]
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
0| | | o | | | | | | | |
1| | o | | o | | | | | | |
2| | o | | | | | | X | | |
3| | | X | X | X | | | | | |
4| | o | | | | | g | | c | |
5| | o | o | | | o | | | c | |
6| | | | o | | | o | | c | |
7| | X | | | | d | | | x | |
8| | | o | o | | d | | | o | |
9| | | | | o | x | o | | | X |
Sunk ships have all their coordinates marked with an uppercase X and hit cells have a lower case x where they were not sunk.
What do we want to build? We are building a shopping cart for an online grocery shop. The idea of this kata is to build the product in an iterative..
Iteration 1 Business rules We want to build an ATM machine and the first thing we need to do, is to create the software that will breakdown which..
In computer science, a stack is a famous abstract data type that provides certain operations on a collection of elements. Stacks have a long history,..
Join our newsletter for expert tips and inspirational case studies
Join our newsletter for expert tips and inspirational case studies