Technology moves fast! ⚡ Don't get left behind.🚶 Subscribe to our mailing list to keep up with latest and greatest in open source projects! 🏆


Subscribe to our mailing list

cube-composer

A puzzle game inspired by functional programming

Subscribe to updates I use cube-composer


Statistics on cube-composer

Number of watchers on Github 1236
Number of open issues 9
Average time to close an issue about 1 month
Main language PureScript
Average time to merge a PR about 6 hours
Open pull requests 1+
Closed pull requests 0+
Last commit almost 2 years ago
Repo Created over 4 years ago
Repo Last Updated over 1 year ago
Size 227 KB
Homepage https://david-pet...
Organization / Authorsharkdp
Contributors1
Page Updated
Do you use cube-composer? Leave a review!
View open issues (9)
View cube-composer activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating cube-composer for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

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

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:

"replaceYbyR" :> {
    name: "map {Yellow}{Red}",
    function: replaceSingle Yellow Red
}

Here, 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

type Stack = List Cube
type Wall = List Stack
type Transformer = Wall -> Wall

Consequently, a Transformer is a function that transforms a 2D array of cubes (Wall). Some basic transformers are given in Transformer.purs.

Each level is given by a record like

"0.2" :-> {
  name: "Level title",
  help: Just "...",
  difficulty: Easy,
  initial: [[Yellow, Yellow, Red], [Yellow, Red], ...],
  target: [[Red], [Red], [Red], [Red], [Red], [Red]]
}

where 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.

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

CI status

Build Status

cube-composer open issues Ask a question     (View All Issues)
  • over 2 years Let players know if better solutions were possible
  • almost 3 years Add option to reset all levels
  • almost 3 years The function dialog sometimes obscures the view (perhaps allow to drag+move it?)
  • almost 3 years Allow localization to other languages
  • over 3 years Mobile version using ReactNative
  • almost 4 years Show level status in drop down
  • about 4 years Boundary checks
  • about 4 years Import and export of programs
  • about 4 years Import and export levels
cube-composer open pull requests (View All Pulls)
  • Make available funcs draggable.
cube-composer list of languages used
Other projects in PureScript