A puzzle game inspired by functional programming
https://github.com/sharkdp/cube-composer.git
A puzzle game inspired by functional programming, written in PureScript.
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.
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.