{"id":15289131,"url":"https://github.com/rborovina/scala-minesweeper","last_synced_at":"2026-03-02T08:34:01.850Z","repository":{"id":247787578,"uuid":"814358678","full_name":"rborovina/scala-minesweeper","owner":"rborovina","description":"This is a Scala implementation of the classic Minesweeper game. The project features different difficulty levels, the ability to save and load games, hints, and a scoring system that takes into account the number of bombs, hints used, elapsed time, and user actions.","archived":false,"fork":false,"pushed_at":"2024-07-10T13:04:33.000Z","size":735,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T12:41:27.779Z","etag":null,"topics":["functional-programming","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/rborovina.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-06-12T21:20:39.000Z","updated_at":"2024-08-08T09:11:21.000Z","dependencies_parsed_at":"2024-07-10T16:30:47.666Z","dependency_job_id":"f136cf69-8a1a-4b87-b593-610c67363c0b","html_url":"https://github.com/rborovina/scala-minesweeper","commit_stats":null,"previous_names":["rborovina/scala-minesweeper"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rborovina/scala-minesweeper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rborovina%2Fscala-minesweeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rborovina%2Fscala-minesweeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rborovina%2Fscala-minesweeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rborovina%2Fscala-minesweeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rborovina","download_url":"https://codeload.github.com/rborovina/scala-minesweeper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rborovina%2Fscala-minesweeper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29995912,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","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":["functional-programming","scala"],"created_at":"2024-09-30T15:59:21.226Z","updated_at":"2026-03-02T08:34:01.819Z","avatar_url":"https://github.com/rborovina.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scala Minesweeper\r\n\r\nThis is a Scala implementation of the classic Minesweeper game. The project features different difficulty levels, the ability to save and load games, hints, and a scoring system that takes into account the number of bombs, hints used, elapsed time, and user actions.\r\n\r\n## Features\r\n\r\n- **Different Difficulty Levels**: Beginner, Intermediate, and Hard.\r\n- **Save and Load Games**: Players can save their progress and resume later.\r\n- **Hints**: Players can request hints during the game.\r\n- **Scoring System**: The score is calculated based on the number of bombs, hints used, elapsed time, and user actions.\r\n- **Best Scores**: View a list of the best scores achieved.\r\n\r\n## Getting Started\r\n\r\n### Prerequisites\r\n\r\n- Scala (2.13.x)\r\n- sbt (1.x)\r\n\r\n### Installation\r\n\r\n1. Clone the repository:\r\n   ```sh\r\n   git clone https://github.com/rborovina/scala-minesweeper.git\r\n   cd scala-minesweeper\r\n   ```\r\n\r\n2. Run the project:\r\n   ```sh\r\n   sbt run\r\n   ```\r\n\r\n## Project Structure\r\n\r\n- `actions`: Contains action-related classes and enums.\r\n- `controller`: Contains the game logic and controller classes.\r\n- `helpers`: Contains helper classes for file operations and game-related utilities.\r\n- `isometrics`: Contains transformations and symmetries used in the game.\r\n- `model`: Contains the core data models (e.g., Cell, BombCell, EmptyCell).\r\n- `traits`: Contains trait definitions used across the project.\r\n- `types`: Contains type aliases for commonly used types.\r\n- `view`: Contains the GUI components and screens.\r\n\r\n## Key Classes and Functions\r\n\r\n### GameController\r\n\r\nThe `GameController` class manages the game state and logic. It handles user actions, calculates the game score, and logs completed games.\r\n\r\n### FileHelper\r\n\r\nThe `FileHelper` object provides methods for saving and loading game states, as well as logging completed games.\r\n\r\n### GameHelper\r\n\r\nThe `GameHelper` object provides utility methods, such as generating unique filenames and calculating the game score.\r\n\r\n### Main Menu\r\n\r\nThe `MainMenuScreen` class provides the main menu interface where players can start a new game, load an existing game, create a new game level, or view the best scores.\r\n\r\n## Scoring System\r\n\r\nThe score is calculated using the following formula:\r\n```scala\r\ndef calculateScore(bombs: Int, hints: Int, elapsedTime: Int, userActions: Int): Int = {\r\n  val baseScore = bombs * 10\r\n  val hintPenalty = hints * 5\r\n  val timePenalty = elapsedTime / 60\r\n  val actionPenalty = userActions * 2\r\n\r\n  baseScore - hintPenalty - timePenalty - actionPenalty\r\n}\r\n```\r\n\r\n## Running the Tests\r\n\r\nTo run the tests, use the following command:\r\n```sh\r\nsbt test\r\n```\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frborovina%2Fscala-minesweeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frborovina%2Fscala-minesweeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frborovina%2Fscala-minesweeper/lists"}