/bataille-navale

A Battleship game playable with a bot. Built in C for Linux.

Primary LanguageCThe UnlicenseUnlicense


Battleship

Table of Contents
  1. About The Project
  2. Context
  3. Built With
  4. Documentation
  5. Getting Started
  6. Usage

About The Project


This project basic principle is: a reproduction of the existing game Battleship playable with a bot (no multiplayer).

Features

  • Play with a bot.
  • Save the game to play later.
  • Game options are configurable.

(back to top)

Context

This project is a personal project and it was my first steps with the C language and Linux programming.

(back to top)

Built With

Entire project was built with C and is only compatible with Linux.

(back to top)

Documentation

Doxygen docs can be generated in HTML by running doxygen command on file doxy/Doxyfile (Doxygen must be installed on your system).

Case symbols meaning:

O : Water case.
# : Water case that represents the boundary of a ship.
B : Case containing the piece of a ship (should be hit).
X : Piece of a ship destroyed.
? : Not discovered case.

Getting Started

To get a local copy up and running follow the steps:

Prerequisites

To compile the project, you will need:

apt-get install make

Optional dependency:

apt-get install doxygen

Installation

  1. Clone the repo:
    git clone https://github.com/Akwd22/bataille-navale.git
  2. Compile the project:
    cd bin
    make

(back to top)

Usage

You can configure game options such as the size of the game board and the number of boats through launch parameters:

  • --help to get the list of parameters:
Battleship

        Usage:
                ./main [options]
        Options:
                --help           Display the list of launch parameters.
                --lp <integer>   Length of the game board (between 5-25 included).
                --hp <integer>   Height of the game board (between 5-25 included).
                --tf <integer>   Fleet size (between 1-10 included).

(back to top)