{"id":41798381,"url":"https://github.com/oezg/minesweeper-kt","last_synced_at":"2026-01-25T05:33:44.701Z","repository":{"id":239226724,"uuid":"798280067","full_name":"oezg/minesweeper-kt","owner":"oezg","description":"Minesweeper game","archived":false,"fork":false,"pushed_at":"2024-06-30T06:12:28.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-07-01T09:47:20.986Z","etag":null,"topics":["functional-programming","kotlin"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oezg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-05-09T13:11:23.000Z","updated_at":"2024-06-30T06:12:27.000Z","dependencies_parsed_at":"2024-06-05T08:06:36.648Z","dependency_job_id":"23b7603c-5c72-470e-8a97-00b29bacc375","html_url":"https://github.com/oezg/minesweeper-kt","commit_stats":null,"previous_names":["oezg/minesweeper-kt"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oezg/minesweeper-kt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oezg%2Fminesweeper-kt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oezg%2Fminesweeper-kt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oezg%2Fminesweeper-kt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oezg%2Fminesweeper-kt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oezg","download_url":"https://codeload.github.com/oezg/minesweeper-kt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oezg%2Fminesweeper-kt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28744429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T05:12:38.112Z","status":"ssl_error","status_checked_at":"2026-01-25T05:04:50.338Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["functional-programming","kotlin"],"created_at":"2026-01-25T05:33:44.233Z","updated_at":"2026-01-25T05:33:44.689Z","avatar_url":"https://github.com/oezg.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Minesweeper (Kotlin)\n\n## Description\n\nThe game starts with an unexplored minefield that has a user-defined number of mines.\n\n#### The player can:\n\n* Mark unexplored cells as cells that potentially have a mine, and also remove those marks. Any empty cell can be marked, not just the cells that contain a mine. The mark is removed by marking the previously marked cell.\n\n* Explore a cell if they think it does not contain a mine.\n\n#### There are three possibilities after exploring a cell:\n\n1. If the cell is empty and has no mines around, all the cells around it, including the marked ones, can be explored, and it should be done automatically. Also, if next to the explored cell there is another empty one with no mines around, all the cells around it should be explored as well, and so on, until no more can be explored automatically.\n\n2. If a cell is empty and has mines around it, only that cell is explored, revealing a number of mines around it.\n\n3. If the explored cell contains a mine, the game ends and the player loses.\n\n#### There are two possible ways to win:\n\n1. Marking all the cells that have mines correctly.\n\n2. Opening all the safe cells so that only those with unexplored mines are left.\n\n## Objectives\n\n* Print the current state of the minefield starting with all unexplored cells at the beginning, ask the player for their next move with the message “`Set/unset mine marks or claim a cell as free:`”, treat the player's move according to the rules, and print the new minefield state. Ask for the player's next move until the player wins or steps on a mine. The player's input contains a pair of cell coordinates and a command: `mine` to mark or unmark a cell, `free` to explore a cell.\n\n* If the player explores a mine, print the field in its current state, with mines shown as `X` symbols. After that, output the message “`You stepped on a mine and failed!`”.\n\n* Generate mines like in the original game: the first cell explored with the free command cannot be a mine; it should always be empty.\n\n#### Use the following symbols to represent each cell’s state:\n\n* `.` as unexplored cells\n\n* `/` as explored free cells without mines around it\n\n* Numbers from 1 to 8 as explored free cells with 1 to 8 mines around them, respectively\n\n* `X` as mines\n\n* `*` as unexplored marked cells\n\n## Examples\n\n### Example 1: the user loses after exploring a cell that contains a mine\n\n```text\nHow many mines do you want on the field? \u003e 10\n\n │123456789│\n—│—————————│\n1│.........│\n2│.........│\n3│.........│\n4│.........│\n5│.........│\n6│.........│\n7│.........│\n8│.........│\n9│.........│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 3 2 free\n\n │123456789│\n—│—————————│\n1│.1///1...│\n2│.1//12...│\n3│11//1....│\n4│////1....│\n5│11111....│\n6│.........│\n7│.........│\n8│.........│\n9│.........│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 1 1 free\n\n │123456789│\n—│—————————│\n1│11///1...│\n2│.1//12...│\n3│11//1....│\n4│////1....│\n5│11111....│\n6│.........│\n7│.........│\n8│.........│\n9│.........│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 1 2 mine\n\n │123456789│\n—│—————————│\n1│11///1...│\n2│*1//12...│\n3│11//1....│\n4│////1....│\n5│11111....│\n6│.........│\n7│.........│\n8│.........│\n9│.........│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 8 8 free\n\n │123456789│\n—│—————————│\n1│11///1...│\n2│*1//12...│\n3│11//1....│\n4│////1....│\n5│11111....│\n6│.........│\n7│.........│\n8│.......1.│\n9│.........│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 7 8 free\n\n │123456789│\n—│—————————│\n1│11///1...│\n2│*1//12...│\n3│11//1....│\n4│////1....│\n5│11111....│\n6│.........│\n7│.........│\n8│......11.│\n9│.........│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 6 8 free\n\n │123456789│\n—│—————————│\n1│11///1...│\n2│*1//12...│\n3│11//1....│\n4│////1....│\n5│11111....│\n6│.........│\n7│.........│\n8│.....211.│\n9│.........│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 2 7 free\n\n │123456789│\n—│—————————│\n1│11///1...│\n2│*1//12...│\n3│11//1....│\n4│////1....│\n5│11111....│\n6│.........│\n7│.3.......│\n8│.....211.│\n9│.........│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 5 6 free\n\n │123456789│\n—│—————————│\n1│11///1X..│\n2│X1//12...│\n3│11//1X...│\n4│////1....│\n5│11111....│\n6│.X..X....│\n7│.3X...X..│\n8│.X..X211.│\n9│...X.....│\n—│—————————│\nYou stepped on a mine and failed!\n```\n\n### Example 2: the user wins by marking all mines correctly\n\n```text\nHow many mines do you want on the field? \u003e 8\n\n │123456789│\n—│—————————│\n1│.........│\n2│.........│\n3│.........│\n4│.........│\n5│.........│\n6│.........│\n7│.........│\n8│.........│\n9│.........│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 5 5 free\n\n │123456789│\n—│—————————│\n1│..1//1...│\n2│111//2...│\n3│/////1...│\n4│/////11..│\n5│//////1..│\n6│/111//1..│\n7│23.1//111│\n8│..21/////│\n9│..1//////│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 2 1 mine\n\n │123456789│\n—│—————————│\n1│.*1//1...│\n2│111//2...│\n3│/////1...│\n4│/////11..│\n5│//////1..│\n6│/111//1..│\n7│23.1//111│\n8│..21/////│\n9│..1//////│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 3 7 mine\n\n │123456789│\n—│—————————│\n1│.*1//1...│\n2│111//2...│\n3│/////1...│\n4│/////11..│\n5│//////1..│\n6│/111//1..│\n7│23*1//111│\n8│..21/////│\n9│..1//////│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 2 8 mine\n\n │123456789│\n—│—————————│\n1│.*1//1...│\n2│111//2...│\n3│/////1...│\n4│/////11..│\n5│//////1..│\n6│/111//1..│\n7│23*1//111│\n8│.*21/////│\n9│..1//////│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 1 8 mine\n\n │123456789│\n—│—————————│\n1│.*1//1...│\n2│111//2...│\n3│/////1...│\n4│/////11..│\n5│//////1..│\n6│/111//1..│\n7│23*1//111│\n8│**21/////│\n9│..1//////│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 7 3 mine\n\n │123456789│\n—│—————————│\n1│.*1//1...│\n2│111//2...│\n3│/////1*..│\n4│/////11..│\n5│//////1..│\n6│/111//1..│\n7│23*1//111│\n8│**21/////│\n9│..1//////│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 8 3 free\n\n │123456789│\n—│—————————│\n1│.*1//1...│\n2│111//2...│\n3│/////1*1.│\n4│/////11..│\n5│//////1..│\n6│/111//1..│\n7│23*1//111│\n8│**21/////│\n9│..1//////│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 9 3 free\n\n │123456789│\n—│—————————│\n1│.*1//1...│\n2│111//2.31│\n3│/////1*1/│\n4│/////111/│\n5│//////111│\n6│/111//1..│\n7│23*1//111│\n8│**21/////│\n9│..1//////│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 8 6 mine\n\n │123456789│\n—│—————————│\n1│.*1//1...│\n2│111//2.31│\n3│/////1*1/│\n4│/////111/│\n5│//////111│\n6│/111//1*.│\n7│23*1//111│\n8│**21/////│\n9│..1//////│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 7 2 free\n\n │123456789│\n—│—————————│\n1│.*1//1...│\n2│111//2231│\n3│/////1*1/│\n4│/////111/│\n5│//////111│\n6│/111//1*.│\n7│23*1//111│\n8│**21/////│\n9│..1//////│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 7 1 mine\n\n │123456789│\n—│—————————│\n1│.*1//1*..│\n2│111//2231│\n3│/////1*1/│\n4│/////111/│\n5│//////111│\n6│/111//1*.│\n7│23*1//111│\n8│**21/////│\n9│..1//////│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 9 1 mine\n\n │123456789│\n—│—————————│\n1│.*1//1*.*│\n2│111//2231│\n3│/////1*1/│\n4│/////111/│\n5│//////111│\n6│/111//1*.│\n7│23*1//111│\n8│**21/////│\n9│..1//////│\n—│—————————│\nCongratulations! You found all the mines!\n```\n\n### Example 3: the user wins by exploring all safe cells\n\n```text\nHow many mines do you want on the field? \u003e 5\n\n │123456789│\n—│—————————│\n1│.........│\n2│.........│\n3│.........│\n4│.........│\n5│.........│\n6│.........│\n7│.........│\n8│.........│\n9│.........│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 5 5 free\n\n │123456789│\n—│—————————│\n1│/////////│\n2│/////111/│\n3│111//1.1/│\n4│..1//1.21│\n5│111//1...│\n6│/////1.21│\n7│/////111/│\n8│111//////│\n9│..1//////│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 1 9 free\n\n │123456789│\n—│—————————│\n1│/////////│\n2│/////111/│\n3│111//1.1/│\n4│..1//1.21│\n5│111//1...│\n6│/////1.21│\n7│/////111/│\n8│111//////│\n9│1.1//////│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 1 4 free\n\n │123456789│\n—│—————————│\n1│/////////│\n2│/////111/│\n3│111//1.1/│\n4│1.1//1.21│\n5│111//1...│\n6│/////1.21│\n7│/////111/│\n8│111//////│\n9│1.1//////│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 7 4 free\n\n │123456789│\n—│—————————│\n1│/////////│\n2│/////111/│\n3│111//1.1/│\n4│1.1//1121│\n5│111//1...│\n6│/////1.21│\n7│/////111/│\n8│111//////│\n9│1.1//////│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 7 5 free\n\n │123456789│\n—│—————————│\n1│/////////│\n2│/////111/│\n3│111//1.1/│\n4│1.1//1121│\n5│111//11..│\n6│/////1.21│\n7│/////111/│\n8│111//////│\n9│1.1//////│\n—│—————————│\nSet/unset mines marks or claim a cell as free: \u003e 8 5 free\n\n │123456789│\n—│—————————│\n1│/////////│\n2│/////111/│\n3│111//1.1/│\n4│1.1//1121│\n5│111//112.│\n6│/////1.21│\n7│/////111/│\n8│111//////│\n9│1.1//////│\n—│—————————│\nCongratulations! You found all the mines!\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foezg%2Fminesweeper-kt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foezg%2Fminesweeper-kt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foezg%2Fminesweeper-kt/lists"}