{"id":20490922,"url":"https://github.com/osoco/exercise-8-queens-victoriadiro","last_synced_at":"2025-10-28T10:42:21.425Z","repository":{"id":139966965,"uuid":"198794692","full_name":"osoco/exercise-8-queens-VictoriaDiro","owner":"osoco","description":"exercise-8-queens-VictoriaDiro created by GitHub Classroom","archived":false,"fork":false,"pushed_at":"2019-07-28T11:43:44.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-05T17:36:22.712Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/osoco.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":"2019-07-25T08:53:31.000Z","updated_at":"2019-07-28T11:43:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"b023a197-97ee-411b-bf18-97492146094d","html_url":"https://github.com/osoco/exercise-8-queens-VictoriaDiro","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"osoco/exercise-8-queens","purl":"pkg:github/osoco/exercise-8-queens-VictoriaDiro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osoco%2Fexercise-8-queens-VictoriaDiro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osoco%2Fexercise-8-queens-VictoriaDiro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osoco%2Fexercise-8-queens-VictoriaDiro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osoco%2Fexercise-8-queens-VictoriaDiro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osoco","download_url":"https://codeload.github.com/osoco/exercise-8-queens-VictoriaDiro/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osoco%2Fexercise-8-queens-VictoriaDiro/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281425556,"owners_count":26499031,"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","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"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":[],"created_at":"2024-11-15T17:19:01.952Z","updated_at":"2025-10-28T10:42:21.388Z","avatar_url":"https://github.com/osoco.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Exercise: 8 queens\n\nLet's try to find a solution to this problem on paper, in an OOP style.\n\n# Context\n\nWe want to place the maximum number of queens in a chess board, so they don't threat each other.\n\nThe provided API is as follows:\n\n## Board\n\nRepresents a chess board with pieces in it. In our context, it will only contain Queens.\n\n```\nwithQueen(Queen): Board\n```\n\nYou can place a new Queen, and you'll get a new board.\n\n```\nthreats(): boolean\n```\n\nYou can use this method to check if the Board contains any threat.\n\n```\nempty(Position): boolean\n```\n\nThis method can be used to check whether you can place a new Queen in given position.\n\n## Queen\n\nIn our model, a Queen represents the piece in a certain position.\n\n```\nposition(): Position\n```\n\nYou can ask the Queen her position, if you need to.\n\n```\nboard(): Board\n```\n\nYou can get the information about the Board.\n\n## Position\n\nRepresents a position in the chess board.\n\n```\nrow(): Number\n```\n\nA number ranging from 1 to 8.\n\n```\ncolumn(): Number\n```\n\nA number ranging from 1 to 8. We won't use standard chess notation.\n\n```\nthreats(Position): boolean\n```\n\nYou can use this method to check whether this position threats another position, according to Queen rules.\n\n# Assignment 1\n\n## QueenSolver\n\nWrite an \"algorithm\" (think of it as a sequence of actions or recipe) resembling the following API:\n\n```\nsolve(): void\nresult(): Solution\n```\n\n## Solution\n\nSolution, on the other hand, can be inspected to find the solution.\n\n```\nsuccess(): boolean\n```\n\nIt returns whether it could find a solution.\n\n```\nsolutions(): List\u003cQueen\u003e\n```\n\nIt returns a list or an array of Queen instances. If its size is not 8, it's considered not successful.\n\n# Assignment 2\n\nTry to generalize the previous solution to allow an arbitrary board size, not only 8.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosoco%2Fexercise-8-queens-victoriadiro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosoco%2Fexercise-8-queens-victoriadiro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosoco%2Fexercise-8-queens-victoriadiro/lists"}