{"id":15720851,"url":"https://github.com/dor-sketch/snakes_ladders","last_synced_at":"2026-01-26T01:01:55.796Z","repository":{"id":238129331,"uuid":"785763231","full_name":"Dor-sketch/Snakes_ladders","owner":"Dor-sketch","description":"Enhanced with Qt6, WebAssembly-ready, and simplified CMake builds.","archived":false,"fork":false,"pushed_at":"2024-06-18T11:59:51.000Z","size":4414,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-27T19:11:54.608Z","etag":null,"topics":["cairo","cairo-drawing","cmake","cpp","game-development","gtk3","qt6"],"latest_commit_sha":null,"homepage":"","language":"C++","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/Dor-sketch.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":"2024-04-12T15:15:10.000Z","updated_at":"2024-10-01T09:27:46.000Z","dependencies_parsed_at":"2024-06-11T09:47:53.407Z","dependency_job_id":"6b0cac82-4594-4d70-b997-78715b3e2ad7","html_url":"https://github.com/Dor-sketch/Snakes_ladders","commit_stats":null,"previous_names":["dor-sketch/snakes_ladders"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dor-sketch%2FSnakes_ladders","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dor-sketch%2FSnakes_ladders/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dor-sketch%2FSnakes_ladders/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dor-sketch%2FSnakes_ladders/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dor-sketch","download_url":"https://codeload.github.com/Dor-sketch/Snakes_ladders/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239500942,"owners_count":19649362,"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","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":["cairo","cairo-drawing","cmake","cpp","game-development","gtk3","qt6"],"created_at":"2024-10-03T22:00:38.323Z","updated_at":"2025-11-06T18:30:31.310Z","avatar_url":"https://github.com/Dor-sketch.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"/images/qt_cover.png\" width=\"800\" /\u003e\n    \u003cbr\u003e\n    \u003ch1 align=\"center\"\u003eSnakes and Ladders Game\u003c/h1\u003e\n    \u003cp align=\"center\"\u003eEnhanced with Qt6, WebAssembly-ready, and simplified CMake builds\u003c/p\u003e\n\u003c/p\u003e\n\nThis project is an implementation of the classic Snakes and Ladders game with a twist - it incorporates musical notes that are played as the players move across the board. The game uses GTK for the GUI and optionally supports MIDI files to generate the notes.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"images/image-4.png\" width=\"200\" /\u003e \u003cimg src=\"images/image-5.png\" width=\"200\" /\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"images/image-6.png\" width=\"200\" /\u003e \u003cimg src=\"images/image-7.png\" width=\"200\" /\u003e\n\u003c/p\u003e\n\n## Table of Contents\n- [Table of Contents](#table-of-contents)\n- [Features](#features)\n- [Prerequisites](#prerequisites)\n- [Installation](#installation)\n  - [Step 1: Install Dependencies](#step-1-install-dependencies)\n  - [Step 2: Build the Project](#step-2-build-the-project)\n    - [Using Makefile](#using-makefile)\n  - [Playing the Game](#playing-the-game)\n- [MIDI Support](#midi-support)\n- [Example](#example)\n- [License](#license)\n- [Contributing](#contributing)\n\n## Features\n\n- Classic Snakes and Ladders gameplay\n- Musical notes played based on player positions\n- Graphical user interface using GTK\n- Optional MIDI file support for generating notes\n\n## Prerequisites\n\n- C++ compiler (e.g., g++)\n- GTK development libraries\n- CMake (optional, for building)\n- MIDI library (optional, if using MIDI files)\n- OpenCV (optional, for image processing)\n\n## Installation\n\n### Step 1: Install Dependencies\n\nFor Ubuntu:\n\n```bash\nsudo apt-get update\nsudo apt-get install build-essential libgtk-3-dev cmake\n```\n\nFor macOS:\n\n```bash\nbrew install gtk+3 cmake\n```\n\n### Step 2: Build the Project\n\nThe project can be built using the provided `Makefile` or `CMakeLists.txt` file.\n\n#### Using Makefile\n\n```bash\nmake \u003cflags\u003e\n```\n\nwhere `\u003cflags\u003e` can be:\n\n- `USE_MIDIFILE=1`: Enable MIDI file support\n- `USE_OPENCV=1`: Enable OpenCV support - not implemented yet\n\n### Playing the Game\n\n1. **Rolling the Dice**: Click the \"Roll\" button to roll the dice and move your player.\n2. **Winning the Game**: The first player to reach the last cell wins the game.\n3. **Musical Notes**: Notes are played based on the player's position on the board.\n\n## MIDI Support\n\nThis project optionally supports using MIDI files to generate the musical notes. To enable this feature:\n\n1. **Install MIDI Library**:\n    - Follow the instructions in the MIDI library's documentation to install it.\n\n2. **Define the `USE_MIDIFILE` Macro**:\n    - Add `#define USE_MIDIFILE` at the top of `game.cpp` or pass it as a compiler flag (`-DUSE_MIDIFILE`).\n\n3. **Link MIDI Library**:\n    - Ensure that the MIDI library is linked during the build process. Modify the build commands or `CMakeLists.txt` accordingly.\n\n4. **Set MIDI File Path**:\n    - Modify the `generateNotes` function in `game.cpp` to use the desired MIDI file path.\n\n## Example\n\nHere is an example of how to modify `game.cpp` to use a MIDI file:\n\n```cpp\n#define USE_MIDIFILE\n#include \"midifile/include/MidiFile.h\"\n\n// Modify generateNotes function\nstd::vector\u003cstd::vector\u003cint\u003e\u003e Game::generateNotes(const std::string \u0026midi_file_path) {\n    std::cout \u003c\u003c \"MIDI file path: \" \u003c\u003c midi_file_path \u003c\u003c std::endl;\n    if (midi_file_path.empty()) {\n        std::cerr \u003c\u003c \"MIDI file path is empty\" \u003c\u003c std::endl;\n        return generateNotes(10);\n    }\n\n    // Open the MIDI file\n    smf::MidiFile midi_file;\n    if (!midi_file.read(midi_file_path)) {\n        std::cerr \u003c\u003c \"Failed to open MIDI file\" \u003c\u003c std::endl;\n        return generateNotes(10);\n    }\n\n    // Create a 2D vector to hold the notes\n    std::vector\u003cstd::vector\u003cint\u003e\u003e notes;\n\n    // Read the MIDI messages\n    for (int track = 0; track \u003c midi_file.getTrackCount(); ++track) {\n        for (int event = 0; event \u003c midi_file[track].getEventCount(); ++event) {\n            if (midi_file[track][event].isNoteOn()) {\n                int note = midi_file[track][event][1];\n                notes.push_back({note});\n            }\n        }\n    }\n\n    return notes;\n}\n```\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions are welcome! Feel free to create an issue or submit a pull request if you have any improvements or bug fixes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdor-sketch%2Fsnakes_ladders","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdor-sketch%2Fsnakes_ladders","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdor-sketch%2Fsnakes_ladders/lists"}