{"id":19757185,"url":"https://github.com/franpog859/battleship","last_synced_at":"2026-05-14T17:09:05.564Z","repository":{"id":103252424,"uuid":"127403470","full_name":"franpog859/battleship","owner":"franpog859","description":"🚢💥 Simple Battleship CLI multiplayer game with a lot of move validators and pointers","archived":false,"fork":false,"pushed_at":"2018-05-29T18:10:06.000Z","size":1051,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T09:20:52.817Z","etag":null,"topics":["battleship","battleship-game","binary-file","c","cli","cmd","crt","game","memory","memory-management","terminal"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/franpog859.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-30T08:33:20.000Z","updated_at":"2023-02-17T00:46:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"e87bea3f-0055-42a2-a786-b4dc267eb174","html_url":"https://github.com/franpog859/battleship","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/franpog859/battleship","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franpog859%2Fbattleship","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franpog859%2Fbattleship/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franpog859%2Fbattleship/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franpog859%2Fbattleship/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/franpog859","download_url":"https://codeload.github.com/franpog859/battleship/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franpog859%2Fbattleship/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33034812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","binary-file","c","cli","cmd","crt","game","memory","memory-management","terminal"],"created_at":"2024-11-12T03:18:21.221Z","updated_at":"2026-05-14T17:09:05.536Z","avatar_url":"https://github.com/franpog859.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Project Battleship\n\n## Description\n\nThis is a Battleship CLI game with a lot of move validators. All these functions make it easy to play. Get ready and set your ships! Your opponent waits for you. All the rules about setting your ship and shooting opponent you will find after typing `-h` flag whenever you want. \n\nThis project is a documentation of my learning process about the C language. You can find here some operations with binary files, a lot of pointers, structures, use of quick sort and much more. I used [CRT library](https://msdn.microsoft.com/en-us/library/x98tx3cf.aspx) to find out if there are no memory leaks. I tried to make it as clean as possible.\n\nIf you can see some drama, some obvious bug or some bad habit tell me! I would be very glad if you do. It is all about learning.\n\n## Used characters as fields\n\n```\n'\t- you do not know yet what it is\n~\t- water field\n#\t- a ship or its part\nX\t- killed ship\n```\n\n## How to build and run it?\n\n1. Clone this repository.\n2. Add all files from the `app` folder to the empty project in your IDE and compile it as `*.c` files.\n3. Have fun time while playing!\n\nUse these flags:\n- `-h` or `--help` to get help with flags\n- `-l` or `--load` to load previously saved game\n- `-s` or `--highScores` to print high scores\n- none just to run the game\n\n## Points counting\n\nHere is how points are counted:\n```c\nint countPoints(GameBoard* gameBoard) {\n\tconst int MAX_NUMBER_OF_TURNS = boardSize * boardSize;\n\tconst int MIN_NUMBER_OF_TURNS = numberOfShips;\n\t\n\treturn MAX_NUMBER_OF_TURNS + MIN_NUMBER_OF_TURNS - gameBoard-\u003enumberOfTurns;\n}\n```\n\n## Here is how the game looks like\n\n![screenshot](https://raw.githubusercontent.com/franpog859/battleship/master/doc/screenshot.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffranpog859%2Fbattleship","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffranpog859%2Fbattleship","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffranpog859%2Fbattleship/lists"}