Code Monkey home page Code Monkey logo

battleship_project's Introduction

Build Status

Battleship project

The traditional Battleship game developed in C++ with terminal interface.

Getting Started

Go to a folder you want the project to be in your file system and type the following in your terminal

git clone https://github.com/iibrahimli/battleship_project.git

Then, install dependencies with:

sudo bash install_dependencies.sh

Or download as archive an unzip in a directory of your choice. Enter the downloaded folder and create a build folder with the following commands

mkdir build
cd build

Compile the project with:

cmake ..
cd ..
make

This will create battleship and tests executables in 'bin' folder and libbs.a static library in 'lib' folder

Running the Game

Game can be executed with the following command from the build directory:

./bin/battleship

In the beginnning the user is asked to enter a name. Then the user will add ships of different sizes ( 2-5 ) to the grid.

NOTE: Make sure to resize your terminal to the minimum recommended size 96 x 32 (96 columns and 32 rows) for the game.

Running the tests

This repository contains also the unit tests written in CPPUnit unit testing framework. In order to make use of these tests you have to install libcppunit-dev library.

sudo apt-get install libcppunit-dev

Tests can be run with the following command from build:

./bin/tests

or

make test

or

ctest .

Authors

Screenshots

User name input and difficulty selection:

greet

Ship placement phase:

ingame1

Shooting phase:

ingame2

battleship_project's People

Contributors

iibrahimli avatar theagh avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.