Skip to content

A CLI application written in C, based on the Battleship board game.

Notifications You must be signed in to change notification settings

bubblechuk/SeaBattle

Repository files navigation

SeaBattle

SeaBattle is a CLI C application created based on famous Battleship game.

Main Menu

alt text

The Main Menu of SeaBattle consist of 4 buttons which can used by pressing keys from 1 to 4

PvP Mode stands for Player vs Player Mode where you can play with another person on a single computer.

PvE Mode is about playing against BOT.

Report Bug is for reporting bugs, it simply redirects you to GitHub repo page.

Exit exits the game. How obvious!

Also there are 3 wonderful chiptune tracks, which fits a retro atmosphere of CLI applications.

Ship Placement

alt text

Important part of SeaBattle is a Ship Placement part.

To place ships correctly, follow these simple instructions:

  1. Use 1, 2, 3, 4 keyboard buttons to select ship size you would like to place. Notice that you can place ships randomly by pressing "r".

  2. Input 3 characters. The first two are for coordinates. The third one are for ship orientation. "v" stands for vertical, "h" for horizontal. For example, "b2v" is for place ship at B2 vertically.

Game

alt text

Just input coordinates to shoot. If you'll hit, your turn continues. Otherwise it will be another player turn. You need to destroy all ships to win. (Score 20 points).

In conclusion

To sum up, I need to mention that this game I wrote without using any help on internet, just for testing my own skills. As it turns out, I wrote incredibly unoptimized piece of code, but I to be frank, I reached an algorithm I invented!

2024. bubblechuk. Rights are NOT reserved!

About

A CLI application written in C, based on the Battleship board game.

Topics

Resources

Stars

Watchers

Forks

Languages