{"id":50396003,"url":"https://github.com/rabestro/dicechess-engine-scala","last_synced_at":"2026-05-30T21:01:00.581Z","repository":{"id":356356216,"uuid":"1231301525","full_name":"rabestro/dicechess-engine-scala","owner":"rabestro","description":"High-performance parallelized Expectimax game engine and probability calculator for Dice Chess, written in Scala 3.","archived":false,"fork":false,"pushed_at":"2026-05-30T15:37:32.000Z","size":917,"stargazers_count":1,"open_issues_count":16,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-30T16:09:59.246Z","etag":null,"topics":["artificial-intelligence","bitboard","chess-engine","dice-chess","expectimax","functional-programming","game-engine","scala","scala3","virtual-threads"],"latest_commit_sha":null,"homepage":"https://jc.id.lv/dicechess-engine-scala/","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rabestro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-06T20:40:56.000Z","updated_at":"2026-05-30T14:28:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rabestro/dicechess-engine-scala","commit_stats":null,"previous_names":["rabestro/dicechess-engine-scala"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/rabestro/dicechess-engine-scala","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fdicechess-engine-scala","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fdicechess-engine-scala/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fdicechess-engine-scala/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fdicechess-engine-scala/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rabestro","download_url":"https://codeload.github.com/rabestro/dicechess-engine-scala/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fdicechess-engine-scala/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33709269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"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":["artificial-intelligence","bitboard","chess-engine","dice-chess","expectimax","functional-programming","game-engine","scala","scala3","virtual-threads"],"created_at":"2026-05-30T21:00:39.469Z","updated_at":"2026-05-30T21:01:00.574Z","avatar_url":"https://github.com/rabestro.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dice Chess Engine (Scala) 🎲♟️\n\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=rabestro_dicechess-engine-scala\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=rabestro_dicechess-engine-scala)\n[![CI Pipeline](https://github.com/rabestro/dicechess-engine-scala/actions/workflows/ci.yaml/badge.svg)](https://github.com/rabestro/dicechess-engine-scala/actions/workflows/ci.yaml)\n[![Play Live](https://img.shields.io/badge/Play-Live-success)](https://dc.jc.id.lv/)\n[![Architecture Docs](https://img.shields.io/badge/Docs-Architecture-orange)](https://jc.id.lv/dicechess-engine-scala/)\n[![Scaladoc API](https://img.shields.io/badge/Scaladoc-API-blue)](https://jc.id.lv/dicechess-engine-scala/api/)\n\n\nAn open-source, high-performance game engine and probability calculator for **Dice Chess**, built with **Scala 3**.\n\nThis engine is designed to calculate win probabilities, evaluate board positions, and suggest the best sequences of micro-moves based on stochastic search algorithms (Expectiminimax or Monte Carlo Tree Search).\n\n---\n\n## 📖 Dice Chess Rules \u0026 Turn Structure\n\nDice Chess is a stochastic variant of chess where players must roll a 6-sided die before making their moves. \n\n### Core Concepts:\n1. **The Turn Structure**:\n   * A player's turn consists of **1 Dice Roll** and **up to 3 micro-moves**.\n   * The active color in the FEN **does not change** within the turn (i.e., during the 1st, 2nd, or 3rd micro-moves). It only changes when the turn ends (after 3 micro-moves, or when no legal moves are available / the player decides to pass).\n   \n2. **The Dice Roll**:\n   * The die determines which pieces are allowed to move:\n     * `1` = Pawn (♙)\n     * `2` = Knight (♘)\n     * `3` = Bishop (♗)\n     * `4` = Rook (♖)\n     * `5` = Queen (♕)\n     * `6` = King (♔)\n     \n3. **Micro-moves**:\n   * You can move **different pieces** or the **same piece** multiple times during your turn, as long as each piece's type matches the rolled die.\n   * If you roll a `3` (Bishop), you can make up to 3 separate bishop moves.\n   * **Victory Condition**: The game is won by **capturing the opponent's king** directly (there is no traditional check/mate, as the king can be captured on the next micro-move).\n   * **Maximum Micro-moves**: Players must play moves that maximize the total number of micro-moves played in their turn. See our detailed [Maximum Micro-moves Rule Algorithm](docs/src/content/docs/architecture/move-generation/05-maximum-micromoves.md) guide for the mathematical formulation and pseudocode.\n\n---\n\n## 🛠️ Tech Stack\n\n* **Language**: Scala 3 (leveraging modern enums, case classes, and type safety)\n* **Concurrency**: Cats Effect 3 / ZIO (for high-performance parallel tree search)\n* **API Framework**: Tapir / Http4s (exposing lightweight REST endpoints)\n* **Build Tool**: sbt (Simple Build Tool)\n\n---\n\n## 🗺️ Pre-Hackathon \u0026 Hackathon Roadmap\n\n```\n[Phase 0: Pre-Hackathon - 2 Months Prep]\n ├── Setup repository structure \u0026 Domain Models (Scala 3)\n ├── Write a FEN Parser for Dice Chess\n └── Define \u0026 implement basic API endpoints (mock responses)\n\n[Phase 1: Hackathon Day 1 - Morning]\n ├── Core Move Generator (handling the 3 micro-moves sequence)\n └── Basic Greedy/Random evaluation\n\n[Phase 2: Hackathon Day 1 - Afternoon \u0026 Night]\n ├── Search Engine implementation (Expectimax or MCTS)\n └── Position Evaluation Function (Material, Position, Mobilty)\n\n[Phase 3: Hackathon Day 2 - Morning]\n ├── Integration of HTTP API with the main PWA Client\n └── Performance profiling and bug fixing\n\n[Phase 4: Hackathon Day 2 - Afternoon]\n └── Demo preparation, benchmarks, and final presentation!\n```\n\n---\n\n## 🔌 API Contract (JSON)\n\n### 1. Suggest Best Move\n`POST /api/v1/engine/suggest`\n\n#### Request\n```json\n{\n  \"dfen\": \"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1 P\",\n  \"depth\": 3\n}\n```\n\n#### Response\n```json\n{\n  \"suggested_turn\": {\n    \"dfen_after_turn\": \"rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 0 1 P\",\n    \"micro_moves\": [\n      { \"from\": \"e2\", \"to\": \"e4\" },\n      { \"from\": \"d2\", \"to\": \"d4\" }\n    ]\n  },\n  \"evaluation\": {\n    \"win_probability\": 0.545,\n    \"score_cp\": 45\n  },\n  \"nodes_searched\": 1420500,\n  \"time_ms\": 120\n}\n```\n\n---\n\n## 📚 Documentation \u0026 API Reference\n\n* **[Live Web App](https://dc.jc.id.lv/)**: Play Dice Chess against our engine's active search algorithms in a premium Svelte PWA environment.\n* **[Architecture \u0026 Developer Guide](https://jc.id.lv/dicechess-engine-scala/)**: Read about our Zero-Cost Abstractions, Hybrid Mailbox, and Milestone roadmap.\n* **[Scaladoc API Reference](https://jc.id.lv/dicechess-engine-scala/api/)**: Comprehensive technical API documentation automatically generated from our codebase.\n\n\n---\n\n## 🚀 Getting Started\n\nEnsure you have [mise](https://mise.jdx.dev/) installed for orchestrating the developer environment.\n\n```bash\n# Clone the repository\ngit clone https://github.com/rabestro/dicechess-engine-scala.git\ncd dicechess-engine-scala\n\n# Installs all required tooling (JDK, Scala CLI, SBT, Formatting tools)\nmise install\n\n# Run the test suite and formatter checks\nmise run check\n\n# Open the interactive Scala 3 REPL loaded with the project\nmise run console\n```\n\n---\n\n## ⚖️ License\n\nThis project is licensed under the **GNU Affero General Public License v3.0 (AGPL-3.0)**. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frabestro%2Fdicechess-engine-scala","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frabestro%2Fdicechess-engine-scala","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frabestro%2Fdicechess-engine-scala/lists"}