A terminal-based implementation of the classic Battleship game with C++ and NCurses/PDCurses.
- Classic Battleship gameplay
- Cross-platform support (Windows/Linux)
- Terminal-based UI with color support
- PvE and PvP mode
- C++17 compatible compiler
- CMake (version 3.15 or higher)
- NCurses (Linux) or PDCurses (Windows)
-
Install dependencies:
# Debian/Ubuntu sudo apt-get install build-essential cmake libncursesw5-dev # Fedora sudo dnf install gcc-c++ cmake ncurses-devel ncurses-compat-libs sudo ln -s /usr/lib64/libncursesw.so.6 /usr/lib64/libtinfow.so.6
-
Clone and build:
git clone https://github.com/ValterGames-Coder/CLI-BattleShip.git cd CLI-BattleShip mkdir build && cd build cmake .. make
-
Install prerequisites:
- Visual Studio with C++ support
- vcpkg for dependencies
-
Set up vcpkg:
git clone https://github.com/microsoft/vcpkg.git cd vcpkg .\bootstrap-vcpkg.bat .\vcpkg install pdcurses:x64-windows .\vcpkg integrate install
-
Build the project (use x64 Native Tools Command Promt for VS):
git clone https://github.com/ValterGames-Coder/CLI-BattleShip.git cd CLI-BattleShip mkdir build cd build cmake -DCMAKE_TOOLCHAIN_FILE="C:\vcpkg\scripts\buildsystems\vcpkg.cmake" .. cmake --build . --config Release
After building, run the executable:
# Linux
cd bin/
./battleship
# Windows
cd \bin\Release
battleship.exeThis project is licensed under the MIT License - see the LICENSE file for details.
