MIT License

项目介绍

sharkdp/cube-composer 是一个托管在 GitHub 上的开源项目,主要使用 PureScript 编写,采用 MIT License 许可证,目前获得 2.1k 个 Star、86 次 Fork。

仓库全名
sharkdp/cube-composer
开源许可证
MIT License
Star 数
2.1k
Fork 数
86
未关闭 Issue
8

README 摘要

A puzzle game inspired by functional programming, written in PureScript. Play it online! Local install 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…

完整内容见 GitHub 原始 README 或本页 。

常见问题

cube-composer 用什么语言开发?

主要使用 PureScript 编写,采用 MIT License 许可证,目前有 2.1k 个 Star。

cube-composer 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 cube-composer 的源码?

可以直接克隆仓库:git clone https://github.com/sharkdp/cube-composer.git,默认分支为 master;安装与运行步骤见仓库 README。

cube-composer 最近还在维护吗?

仓库最近一次更新为 3 周前,当前有 8 个未关闭 Issue;Star 数为 2.1k,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

A puzzle game inspired by functional programming

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
2247
价值分
1260
活跃状态
活跃

语言占比

HTML
JavaScript
Less
PureScript
Shell

README

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:

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

To 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):

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

评论

暂无评论