{"id":22967799,"url":"https://github.com/sahilcreate/battleship","last_synced_at":"2026-05-18T10:06:35.893Z","repository":{"id":266699565,"uuid":"898813668","full_name":"Sahilcreate/Battleship","owner":"Sahilcreate","description":"The classic game 'Battleship', using Test-Driven-Development","archived":false,"fork":false,"pushed_at":"2024-12-09T08:50:03.000Z","size":135,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-29T12:08:29.019Z","etag":null,"topics":["battleship-game","js","testdrivendevlopment","webpack"],"latest_commit_sha":null,"homepage":"https://sahilcreate.github.io/Battleship/","language":"JavaScript","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/Sahilcreate.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,"zenodo":null}},"created_at":"2024-12-05T04:48:51.000Z","updated_at":"2025-08-19T07:40:22.000Z","dependencies_parsed_at":"2024-12-05T16:37:08.734Z","dependency_job_id":"aa27abd4-cbe6-4408-ab89-fad0581cc706","html_url":"https://github.com/Sahilcreate/Battleship","commit_stats":null,"previous_names":["sahilcreate/battleship"],"tags_count":0,"template":false,"template_full_name":"Sahilcreate/template-repo","purl":"pkg:github/Sahilcreate/Battleship","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sahilcreate%2FBattleship","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sahilcreate%2FBattleship/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sahilcreate%2FBattleship/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sahilcreate%2FBattleship/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sahilcreate","download_url":"https://codeload.github.com/Sahilcreate/Battleship/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sahilcreate%2FBattleship/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33174091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-game","js","testdrivendevlopment","webpack"],"created_at":"2024-12-14T21:14:50.344Z","updated_at":"2026-05-18T10:06:35.873Z","avatar_url":"https://github.com/Sahilcreate.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sea-Nanigens\n\n## Result\n\n[Click to try game live](https://sahilcreate.github.io/Battleship/)\n\n![Game Preview](./resources-and-notes/preview.png)\n\n## About the project\n\nThe main purpose was to practice Test Driven Development (TDD). We were asked to implement the classic game 'Battleship' while using TDD.\n\n## Assignment\n\n- [x] Your ‘ships’ will be objects that include their length, the number of times they’ve been hit and whether or not they’ve been sunk.\n- [x] **REMEMBER** you only have to test your object’s public interface. Only methods or properties that are used outside of your ‘ship’ object need unit tests.\n- [x] Ships should have a `hit()` function that increases the number of ‘hits’ in your ship\n- [x] `isSunk()` should be a function that calculates whether a ship is considered sunk based on its length and the number of hits it has received.\n- [x] Gameboards should be able to place ships at specific coordinates by calling the ship factory or class.\n- [x] Gameboards should have a `receiveAttack` function that takes a pair of coordinates, determines whether or not the attack hit a ship and then sends the ‘hit’ function to the correct ship, or records the coordinates of the missed shot.\n- [x] Gameboards should be able to report whether or not all of their ships have been sunk.\n- [x] There will be two types of players in the game, ‘real’ players and ‘computer’ players. Each player object should contain its own gameboard.\n- [x] Players should take turns playing the game by attacking the enemy Gameboard.\n- [x] make the ‘computer’ players capable of making random plays. The computer does not have to be smart, but it should know whether or not a given move is legal.\n- [x] Create conditions so that the game ends once one player’s ships have all been sunk\n\n## Maybe in future\n\n- [x] Implement drag and drop to allow players to place their ships.\n- [ ] Create a 2-player option that lets users take turns by passing the laptop back and forth, or by spinning the monitor around on a desktop. Implement a ‘pass device’ screen so that players don’t see each other’s boards!\n- [ ] Polish the intelligence of the computer player by having it try adjacent slots after getting a ‘hit’.\n- [ ] Better visual and graphics\n- [ ] Add sound effects\n- [ ] Let user add their names\n- [ ] Reset board option to again start game after it ends\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsahilcreate%2Fbattleship","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsahilcreate%2Fbattleship","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsahilcreate%2Fbattleship/lists"}