{"id":13525447,"url":"https://github.com/sharkdp/cube-composer","last_synced_at":"2026-01-28T14:02:42.542Z","repository":{"id":28406530,"uuid":"31920956","full_name":"sharkdp/cube-composer","owner":"sharkdp","description":"A puzzle game inspired by functional programming","archived":false,"fork":false,"pushed_at":"2022-12-08T09:23:40.000Z","size":692,"stargazers_count":2012,"open_issues_count":10,"forks_count":84,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-03-03T13:44:59.371Z","etag":null,"topics":["browser-game","functional-programming","game","programming-exercise","purescript","puzzle"],"latest_commit_sha":null,"homepage":"https://david-peter.de/cube-composer","language":"PureScript","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/sharkdp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"sharkdp"}},"created_at":"2015-03-09T20:30:17.000Z","updated_at":"2025-02-22T16:10:14.000Z","dependencies_parsed_at":"2023-01-14T08:45:43.361Z","dependency_job_id":null,"html_url":"https://github.com/sharkdp/cube-composer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sharkdp/cube-composer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharkdp%2Fcube-composer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharkdp%2Fcube-composer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharkdp%2Fcube-composer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharkdp%2Fcube-composer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sharkdp","download_url":"https://codeload.github.com/sharkdp/cube-composer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharkdp%2Fcube-composer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28846058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T13:02:32.985Z","status":"ssl_error","status_checked_at":"2026-01-28T13:02:04.945Z","response_time":57,"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":["browser-game","functional-programming","game","programming-exercise","purescript","puzzle"],"created_at":"2024-08-01T06:01:18.795Z","updated_at":"2026-01-28T14:02:42.511Z","avatar_url":"https://github.com/sharkdp.png","language":"PureScript","readme":"![cube composer](https://raw.githubusercontent.com/sharkdp/cube-composer/master/img/cube-composer.png)\n\nA puzzle game inspired by functional programming,\nwritten in [PureScript](https://github.com/purescript/purescript).\n\n[**Play it online!**](https://david-peter.de/cube-composer)\n\n## Local install\n\n```sh\ngit clone https://github.com/sharkdp/cube-composer.git\ncd cube-composer\nnpm install\nbower install\ngulp\n```\nIf no errors occur, the game can now be played on a browser by opening `index.html`.\n\n## Creating new levels\n\nLevels are grouped into chapters. Each chapter has a dedicated file in the folder [`src/Levels/`](src/Levels/). To create a new chapter, you can copy one of the existing files, bump the chapter number and add it to the `allChapters` list in [`Levels.purs`](src/Levels.purs). Each chapter comes with a specific list of `transformers` (functions). As an example, we look at `map (Yellow ↦ Red)` in `Chapter0.purs`:\n``` purescript\n\"replaceYbyR\" :\u003e {\n    name: \"map {Yellow}↦{Red}\",\n    function: replaceSingle Yellow Red\n}\n```\nHere, `replaceYbyR` is an internal ID which is used to identify the transformer, `map {Yellow}↦{Red}` is the displayed name of the transformer (`{x}` will be replaced by a small cube of color `x`) and `replaceSingle Yellow Red` is the implementation of the transformer. The `function` field in the record has to be of type `Transformer`, where\n``` purescript\ntype Stack = List Cube\ntype Wall = List Stack\ntype Transformer = Wall -\u003e Wall\n```\nConsequently, a `Transformer` is a function that transforms a 2D array of cubes (`Wall`). Some basic transformers are given in [`Transformer.purs`](src/Transformer.purs).\n\nEach level is given by a record like\n``` purescript\n\"0.2\" :-\u003e {\n  name: \"Level title\",\n  help: Just \"...\",\n  difficulty: Easy,\n  initial: [[Yellow, Yellow, Red], [Yellow, Red], ...],\n  target: [[Red], [Red], [Red], [Red], [Red], [Red]]\n}\n```\nwhere `0.2` is the `Chapter.Level` ID of the level, `name` is the title of the puzzle, `help` is the help text shown in the right panel, difficulty is `Easy`, `Medium` or `Hard` and `initial :: Wall` and `target :: Wall` are the inital and target 2D arrays of cubes.\n\nTo view all levels with all shortest solutions for each (can be useful, among other things, to verify newly introduced levels can be solved as planned – and cannot be solved in another way which undermines their point):\n```sh\ngulp prod\nnode dist/cli.js\n```\n\nPlease send a pull request if you would like to add your puzzles to the game.\n\n## CI status\n[![Build Status](https://img.shields.io/travis/sharkdp/cube-composer.svg?style=flat)](https://travis-ci.org/sharkdp/cube-composer)\n","funding_links":["https://github.com/sponsors/sharkdp"],"categories":["PureScript","Browser-Based","Resources","Puzzle"],"sub_categories":["Puzzle","[Elm](http://elm-lang.org)","Examples and Exercises"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharkdp%2Fcube-composer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsharkdp%2Fcube-composer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharkdp%2Fcube-composer/lists"}