{"id":16815179,"url":"https://github.com/aayushmau5/battleship","last_synced_at":"2025-03-22T03:31:17.873Z","repository":{"id":114546772,"uuid":"524438385","full_name":"aayushmau5/battleship","owner":"aayushmau5","description":"Battleship game made using Elixir \u0026 Phoenix framework","archived":false,"fork":false,"pushed_at":"2024-04-29T20:05:50.000Z","size":111,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T06:16:35.301Z","etag":null,"topics":["elixir","game","phoenix"],"latest_commit_sha":null,"homepage":"https://battleship.aayushsahu.com/","language":"Elixir","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/aayushmau5.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":"2022-08-13T15:35:20.000Z","updated_at":"2024-05-16T16:07:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"724130c7-4e08-4791-a842-aa8d017fba92","html_url":"https://github.com/aayushmau5/battleship","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aayushmau5%2Fbattleship","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aayushmau5%2Fbattleship/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aayushmau5%2Fbattleship/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aayushmau5%2Fbattleship/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aayushmau5","download_url":"https://codeload.github.com/aayushmau5/battleship/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244902929,"owners_count":20529114,"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":["elixir","game","phoenix"],"created_at":"2024-10-13T10:33:20.129Z","updated_at":"2025-03-22T03:31:17.105Z","avatar_url":"https://github.com/aayushmau5.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Battleship\n\nBattleship game made using Elixir \u0026 Phoenix framework ❤️\n\nYou can:\n\n- Play against computer\n- Play against another player in real-time\n- Create private rooms to play against a particular player\n\n## Deployment\n\nDeployed on [fly.io](https://fly.io) 💪\n\nLive at https://aayush-battleship.fly.dev/ 😎\n\n## Setup\n\nCheckout the setup guide for Phoenix: https://hexdocs.pm/phoenix/installation.html\n\n## Internals\n\n### Approach(logical)\n\n- Start with a 10 x 10 matrix(all 0)\n- 4 types of ships based on their length(all different)\n- When user places a ship of certain length, we set the length in the given matrix at the desired position\n- If a ship is hit, we set -1 at that position, if it is a miss, we assign -2 at that position\n- Check the matrix for any natural number(\u003e 0), if there is none, user has won the game\n\n## TODO\n\n- Refactor game logic and main game server\n- Add internal workings in readme\n\n\u003c!-- ### Workflow\n\nPhoenix creates a process for each client connected to the server, so we use process to process communication through Phoenix PubSub.\n\nHere's a high level overview of how it works:\n\n![High level overview](https://user-images.githubusercontent.com/54525741/199268118-fc78a57c-883a-4533-ac6f-5969d45b8797.png)\n\nHaving every client with their own process unlocks a powerful way of organizing the workflow.\n\nWith the help of Phoenix Presence, and Phoenix PubSub\n\n// More details here\n// About handshake\n// About generating room\n// About know full room --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faayushmau5%2Fbattleship","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faayushmau5%2Fbattleship","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faayushmau5%2Fbattleship/lists"}