A terminal battleship game in Rust

Overview

Battleship.rs

A terminal battleship game in Rust.

Run with docker:

$ docker run --rm -it deepu105/battleship:main

demo

This is slightly different than the traditional battleship game.

There are 4 types of ships that will be placed randomly at different rotations in each players board

  • Fighter [X shaped]
  • Carrier [H shaped]
  • Destroyer [V shaped]
  • Scout [I shaped]

There are 3 rules with which the game can be played. This can be passed as argument -r <fury|charge> to the CLI

  • Default: Only one salvo/shot per turn
  • Fury: You can select salvo/shot up to the number of ships alive in your board
  • Charge: You start with one salvo/shot per turn and as you sunk opponent ships you get one additional shot per ship sunken

The default difficulty level is hard. You can set to easy difficulty by passing -d <easy|hard> to the CLI

pass -h for help

You can also clone the repo and run cargo run

Note: Works only in Linux/Mac for Windows use docker command above.

TODO: Make this work also in web assembly

UI inspired from https://github.com/cpcloud/minesweep-rs

You might also like...
Wasm game of life - A Rust and WebAssembly tutorial implementing the Game of Life

wasm_game_of_life Conway's Game of Life in Rust and WebAssembly Contributing | Chat Built with 🦀 🕸 by The Rust and WebAssembly Working Group About T

Conway's Game of Life implemented for Game Boy Advance in Rust

game-of-life An implementation of a Conway's Game of Life environment on GBA. The ultimate game should have two modes: Edit and Run mode which can be

2d Endless Runner Game made with Bevy Game Engine
2d Endless Runner Game made with Bevy Game Engine

Cute-runner A 2d Endless Runner Game made with Bevy Game Engine. Table of contents Project Infos Usage Screenshots Disclaimer Project Infos Date: Sept

A game for the game jam
A game for the game jam "1-Button Jam 2021"

One click ninja A game for the game jam "1-Button Jam 2021" written in Rust with the Bevy engine. A rhythm game, where you play a soldier that can def

My first attempt at game programming. This is a simple target shooting game built in macroquad.

sergio My first attempt at game programming. This is a simple target shooting game built in macroquad. Rules Hit a target to increase score by 1 Score

A game made in one week for the Bevy engine's first game jam

¿Quien es el MechaBurro? An entry for the first Bevy game jam following the theme of "Unfair Advantage." It was made in one week using the wonderful B

A Client/Server game networking plugin using QUIC, for the Bevy game engine.
A Client/Server game networking plugin using QUIC, for the Bevy game engine.

Bevy Quinnet A Client/Server game networking plugin using QUIC, for the Bevy game engine. Bevy Quinnet QUIC as a game networking protocol Features Roa

Managed game servers, matchmaking, and DDoS mitigation that lets you focus on building your game
Managed game servers, matchmaking, and DDoS mitigation that lets you focus on building your game

Managed game servers, matchmaking, and DDoS mitigation that lets you focus on building your game. Home - Docs - Twitter - Discord 👾 Features Everythi

Terminal command correction, alternative to thefuck written in Rust
Terminal command correction, alternative to thefuck written in Rust

Pay Respects Typed a wrong command? Pay Respects will try to correct your wrong console command by simply pressing F! 🚀 Blazing fast suggestion: You

Owner
Deepu K Sasidharan
@jhipster co-lead, Developer Advocate, Software Solution Designer, passionate about emerging technologies. OSS aficionado. Polyglot dev https://deepu.tech
Deepu K Sasidharan
rpg-cli is a bare-bones JRPG-inspired terminal game written in Rust

rpg-cli is a bare-bones JRPG-inspired terminal game written in Rust. It can work as an alternative to cd where you randomly encounter enemies as you change directories.

Facundo Olano 660 May 27, 2021
Terminal-based Snake game written in Rust without dependencies (for educational purposes).

RustSnake This is a simple terminal-based Snake game implemented in Rust without dependencies. To start the game type cargo run. Control the snake usi

Florian Wickert 88 Jan 6, 2023
A simple space shooter game. Runs in the terminal using characters-based UI. Fully written in Rust, using the "ruscii" library.

Thrust - a terminal shooter game Originally created as a project for the "Missing Semester" course at JKU Linz (338.006). The game is entirely written

Mathias Wöß 3 Jan 16, 2023
Terminal typing "game"

ToggleCoolCowSaysType A terminal based typing game. Usage: toggle_cool_cow_says_type [-t {word_count}] [-t {file_extension}] [-s] {project_path} -s :

Togglebit 23 Sep 27, 2022
Terminal UI implementation and types for the Dark Forest game

dark-forest.rs Terminal UI implementation and types for the Dark Forest game Development We use the standard Rust toolchain cargo check

Georgios Konstantopoulos 63 Nov 12, 2022
A terminal based game engine

ccdb: The cmd game engine (Thats also multi threaded) How to use Tutorial Multi threading If you want to use multi threading you have to use ACore The

null 34 Oct 19, 2022
Victorem - easy UDP game server and client framework for creating simple 2D and 3D online game prototype in Rust.

Victorem Easy UDP game server and client framework for creating simple 2D and 3D online game prototype in Rust. Example Cargo.toml [dependencies] vict

Victor Winbringer 27 Jan 7, 2023
2-player game made with Rust and "ggez" engine, based on "Conway's Game of Life"

fight-for-your-life A 2-player game based on the "Conway's Game of Life", made with Rust and the game engine "ggez". Create shapes on the grid that wi

Petros 3 Oct 25, 2021
A tetris game I wrote in rust using ncurses. I'm sure that there's a better way to write a tetris game, and the code may be sus, but it techinically works

rustetris A tetris game I wrote in rust using ncurses. I'm sure that there's a better way to write a tetris game, and the code may be sus, but it tech

Eric G 3 Oct 15, 2022
A game of snake written in Rust using the Bevy game engine, targeting WebGL2

Snake using the Bevy Game Engine Prerequisites cargo install cargo-make Build and serve WASM version Set your local ip address in Makefile.toml (loca

Michael Dorst 0 Dec 26, 2021