{"id":15395157,"url":"https://github.com/orhun/battleship-rs","last_synced_at":"2025-07-03T18:35:37.965Z","repository":{"id":43107091,"uuid":"485890129","full_name":"orhun/battleship-rs","owner":"orhun","description":"Battleship game implemented in Rust","archived":false,"fork":false,"pushed_at":"2024-05-29T20:50:06.000Z","size":342,"stargazers_count":92,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T21:42:50.484Z","etag":null,"topics":["battleship","battleship-game","battleship-multiplayer","hacktoberfest","rust-game","rust-gamedev","tcp-sockets"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orhun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":"orhun","patreon":"orhunp"}},"created_at":"2022-04-26T17:45:47.000Z","updated_at":"2025-02-09T03:11:29.000Z","dependencies_parsed_at":"2023-12-31T12:22:39.500Z","dependency_job_id":null,"html_url":"https://github.com/orhun/battleship-rs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/orhun/battleship-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhun%2Fbattleship-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhun%2Fbattleship-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhun%2Fbattleship-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhun%2Fbattleship-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orhun","download_url":"https://codeload.github.com/orhun/battleship-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhun%2Fbattleship-rs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263379972,"owners_count":23457938,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["battleship","battleship-game","battleship-multiplayer","hacktoberfest","rust-game","rust-gamedev","tcp-sockets"],"created_at":"2024-10-01T15:26:14.479Z","updated_at":"2025-07-03T18:35:37.937Z","avatar_url":"https://github.com/orhun.png","language":"Rust","funding_links":["https://github.com/sponsors/orhun","https://patreon.com/orhunp"],"categories":[],"sub_categories":[],"readme":"## Battleship 🚢\n\n[Battleship game](https://en.wikipedia.org/wiki/Battleship_(game)) implemented in Rust.\n\n![demo](assets/demo.gif)\n\nFully playable between 2 players on the terminal.\n\nTo play on the public instance:\n\n```shell-session\n$ nc battleship.orhun.dev 1234\n```\n\n### Building\n\nMinimum supported Rust version: `1.38.0`\n\n```shell-session\n$ cargo build --release\n```\n\n### Running\n\n```shell-session\n$ ./target/release/battleship\n```\n\nThis will start the server on port `1234`, then players can connect to it with any tool that supports TCP sockets. For example, using [netcat](https://en.wikipedia.org/wiki/Netcat):\n\n```shell-session\n$ nc 127.0.0.1 1234\n```\n\n### Docker\n\n[Dockerfile](./Dockerfile) is available in the repository.\n\n#### Building\n\n```shell-session\n$ docker build -t battleship .\n```\n\n#### Running\n\n```shell-session\n$ docker run --rm -d --name battleship -p 1234:1234 battleship\n```\n\n### Configuring\n\nYou can use the following environment variables for specifying the game settings:\n\n- `BATTLESHIP_SOCKET`: TCP socket address (default: `127.0.0.1:1234`)\n- `BATTLESHIP_GRID_WIDTH`: Width of the game grid (default: `10`)\n- `BATTLESHIP_GRID_HEIGHT`: Height of the game grid (default: `10`)\n\n### Playing\n\nAfter joining the game, players take turns firing shots (by calling out a grid coordinate) to attempt to hit the opponent's enemy ships. Example coordinates would be `a1`, `g8`, `E4`, `I2`, and so on.\n\n![hit](assets/hit.jpg)\n\nEach player has two grids: an upper and lower grid.\n\n![grids](assets/grid.jpg)\n\nThe lower grid views the location of the player's own ships, while the upper grid shows the shots fired toward the opponent and also gives information about whether those shots were hits or misses.\n\n- `☒`: hit\n- `✕`: missed\n\n#### Ship types\n\n1. Boat\n\n```\n△\n```\n\n2. Destroyer\n\n```\n▯\n▯\n```\n\n3. Battleship\n\n```\n▧▧\n▧▧\n▧▧\n```\n\n### License\n\n\u003csup\u003e\nAll code is licensed under \u003ca href=\"LICENSE\"\u003eThe MIT License\u003c/a\u003e.\n\u003c/sup\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forhun%2Fbattleship-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forhun%2Fbattleship-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forhun%2Fbattleship-rs/lists"}