Battleship game for two players
git clone https://github.com/thecoldstone/lab_program.git
Use the make file to build the project.
make
./main a) The current version is supposed for two players sharing the same shell interface. The logic of a game is straightforward and based on the following steps:
- User's input
- Initialization of board and ships
- Game logic itself
- Deallocation of allocated memory
INPUT and INITIALIZATION
- User choose the board size
- User choose the number of ships to place on a board
- User choose the way to insert ships:
- Put ships manually
- Put ships randomly
GAME LOGIC
- User see the opponent's board and choose the coordinates where to shoot
- If the user hits he is continuing the step 1
- Once the user has destroyed every ship belonged to the opponent the game finishes
DEALLOCATION
main.c
#Game logic
- battleship.*
- ship_setup.*
#Structures
- user.*
- board.*
- ship.*
#Others
- io_handler.*
- utilities.h
make clean1. Scanner for input does not work well. It accepts only integers. If user type something else intstead of integers, program is crashed.
2. Error handling.
3. Still some memory leaks occur during deallocating of the program.