๐Ÿ“ฆ sharkdp / cube-composer

A puzzle game inspired by functional programming

โ˜… 2.0k stars โ‘‚ 85 forks ๐Ÿ‘ 2.0k watching โš–๏ธ MIT License
browser-gamefunctional-programminggameprogramming-exercisepurescriptpuzzle
๐Ÿ“ฅ Clone https://github.com/sharkdp/cube-composer.git
HTTPS git clone https://github.com/sharkdp/cube-composer.git
SSH git clone git@github.com:sharkdp/cube-composer.git
CLI gh repo clone sharkdp/cube-composer
dependabot[bot] dependabot[bot] Bump async from 2.6.3 to 2.6.4 a891ffe 3 years ago ๐Ÿ“ History
๐Ÿ“‚ master View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ cli
๐Ÿ“ css
๐Ÿ“ docs
๐Ÿ“ img
๐Ÿ“ src
๐Ÿ“„ .gitignore
๐Ÿ“„ .htaccess
๐Ÿ“„ .travis.yml
๐Ÿ“„ bower.json
๐Ÿ“„ gulpfile.js
๐Ÿ“„ index.html
๐Ÿ“„ LICENSE
๐Ÿ“„ package-lock.json
๐Ÿ“„ package.json
๐Ÿ“„ README.md
๐Ÿ“„ README.md
cube composer

A puzzle game inspired by functional programming, written in PureScript.

Play it online!

Local install

git clone https://github.com/sharkdp/cube-composer.git
cd cube-composer
npm install
bower install
gulp
If no errors occur, the game can now be played on a browser by opening index.html.

Creating new levels

Levels are grouped into chapters. Each chapter has a dedicated file in the folder 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. Each chapter comes with a specific list of transformers (functions). As an example, we look at map (Yellow โ†ฆ Red) in Chapter0.purs: `` purescript "replaceYbyR" :> { name: "map {Yellow}โ†ฆ{Red}", function: replaceSingle Yellow Red } %%CODEBLOCK1%% purescript type Stack = List Cube type Wall = List Stack type Transformer = Wall -> Wall %%CODEBLOCK2%% purescript "0.2" :-> { name: "Level title", help: Just "...", difficulty: Easy, initial: [[Yellow, Yellow, Red], [Yellow, Red], ...], target: [[Red], [Red], [Red], [Red], [Red], [Red]] } %%CODEBLOCK3%%sh gulp prod node dist/cli.js ``

Please send a pull request if you would like to add your puzzles to the game.

CI status

Build Status