https://github.com/luochen1990/craft-calc
A DSL for MineCraft Material Calculation
https://github.com/luochen1990/craft-calc
craft-calc dsl minecraft
Last synced: about 1 year ago
JSON representation
A DSL for MineCraft Material Calculation
- Host: GitHub
- URL: https://github.com/luochen1990/craft-calc
- Owner: luochen1990
- License: mit
- Created: 2016-09-11T16:54:27.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-01-04T01:30:32.000Z (over 8 years ago)
- Last Synced: 2025-03-14T01:25:03.209Z (over 1 year ago)
- Topics: craft-calc, dsl, minecraft
- Language: Haskell
- Size: 1.14 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Craft Calc
==========
Craft Calc is a Domain Specific Language (DSL) for **Calculating Materials Needed** when Crafting
When given a set of crafting rules (via editing the file named "rules.txt"), this program can calculate the materials needed for crafting your target (described in the file named "input.txt").
Demo
----
rules.txt
```
basic_materials: Wood, Coal
WoodenPlank = Wood
Stick = WoodenPlank * 2
Torch = Coal + Stick
```
input.txt
```
(Torch * 10) % basicMaterials
```
output
```
(Torch * 10) % basicMaterials
= Wood * 20 + Coal * 10
```
Run Demo
--------
```
ghc craft-calc.hs -o calc.exe
mv calc.exe demo1/
cd demo1
./calc.exe
```
Todo
----
- Fractional number support
- Multiple crafting path support
- Calculate the least cost and show the crafting plan
- Better alias support
- Macro support