master
Lindsey Handley 2017-12-22 11:51:55 -08:00
commit cd12342177
6 changed files with 1098 additions and 0 deletions

80
blocks.rkt Normal file
View File

@ -0,0 +1,80 @@
#lang racket
(provide block-struct)
(provide block-struct?)
(provide compile-blocks)
(require 2htdp/image)
(require "core.rkt")
;minetest.register_node("mymod:diamond", {
; description = "Alien Diamond",
; tiles = {"mymod_diamond.png"},
; is_ground_content = true,
; groups = {cracky=3, stone=1}
;})
(struct block-struct asset-struct (tiles groups) #:transparent)
(define/contract (export-tiles-to-file m b)
(-> mod-struct? block-struct? (listof boolean?))
(map save-image
(block-struct-tiles b)
(map (lambda (n)
(++ (path-for m)
"/textures/"
n))
(block-file-names b))))
(define/contract (block-file-names b)
(-> block-struct? (listof string?))
(map (lambda (num) (++ (asset-struct-name b) "_tile_" (number->string num) ".png"))
(range (length (block-struct-tiles b)))))
(define/contract (compile-block-tiles m b)
(-> mod-struct? block-struct? string?)
(let ([file-names (block-file-names b)])
(format "tiles = ~a" (compile-arr file-names STR_TYPE))))
(define/contract (compile-block-group m b)
(-> mod-struct? block-struct? string?)
(format "groups = ~a" (compile-ass-arr
(block-struct-groups b)
SYM_TYPE
INT_TYPE)))
(define/contract (compile-block m b)
(-> mod-struct? block-struct? string?)
(++ "-- My block is named " (asset-name b) "\n"
(format
" minetest.register_node(\"~a:~a\", {
~a,
~a,
~a,
})\n\n" (mod-struct-name m) (asset-name b)
(compile-asset-description m b)
(compile-block-tiles m b)
(compile-block-group m b)
)))
(define/contract (export-block-code m b)
(-> mod-struct? block-struct? boolean?)
(with-output-to-file (lua-file-for m) #:exists 'append
(lambda () (printf (++
(compile-block m b)
"\n"))))
#t)
(define/contract (compile-blocks m is)
(-> mod-struct? (listof block-struct?) boolean?)
(and
(all-true (flatten (map (curry export-tiles-to-file m) is)))
(all-true (map (curry export-block-code m) is))
))

33
compiler.rkt Normal file
View File

@ -0,0 +1,33 @@
#lang racket
(require 2htdp/image)
(provide mod)
(provide compile-mod)
(require "core.rkt")
(require "items.rkt")
(require "blocks.rkt")
(require "recipes.rkt")
(define/contract (compile-mod m)
(-> mod-struct? boolean?)
(displayln m)
(make-directory* (path-for m))
(make-directory* (++ (path-for m) "/textures"))
(with-output-to-file (lua-file-for m) #:exists 'replace
(lambda () (printf (++
"-- This is my mod! It's called "
(mod-struct-name m)
"\n\n\n"))))
(and
(compile-blocks m (mod-struct-blocks m))
(compile-items m (mod-struct-items m))
(compile-recipes m (mod-struct-recipes m))
))
(define (mod name . things )
(mod-struct name (filter item-struct? things)
(filter block-struct? things)
'()))

108
core.rkt Normal file
View File

@ -0,0 +1,108 @@
#lang racket
(provide ++)
(provide all-true)
(provide asset-struct)
(provide mod-struct)
(provide mod-struct-blocks)
(provide mod-struct-items)
(provide mod-struct-recipes)
(provide MINETEST_PATH)
(provide path-for)
(provide asset-name)
(provide asset-struct)
(provide asset-struct-name)
(provide compile-arr)
(provide compile-ass-arr)
(provide compile-asset-description)
(provide lua-file-for)
(provide STR_TYPE)
(provide SYM_TYPE)
(provide INT_TYPE)
(provide path-for)
(provide mod-struct)
(provide mod-struct?)
(provide mod-struct-name)
(define STR_TYPE "~s")
(define INT_TYPE "~a")
(define SYM_TYPE "~a")
;UTIL
(define ++ string-append)
(define/contract (all-true l)
(-> list? boolean?)
(= (count identity l) (length l)))
;CONFIG
(define MINETEST_PATH "/home/thoughtstem/.minetest/")
;DATA STRUCTURES
(struct mod-struct (name items blocks recipes) #:transparent)
(struct asset-struct (name description) #:transparent)
(define (variableify s)
(string-downcase
(string-replace
s
" "
"_")))
(define (asset-name a)
(variableify (asset-struct-name a)))
(define (asset-description a)
(asset-struct-description a))
(define/contract (lua-file-for m)
(-> mod-struct? string?)
(string-append
(path-for m)
"/init.lua"))
(define/contract (path-for m)
(-> mod-struct? string?)
(string-append MINETEST_PATH "/mods/" (mod-struct-name m)))
(define/contract (compile-asset-description m i)
(-> mod-struct? asset-struct? string?)
(format "description = ~s" (asset-description i)))
(define/contract (compile-arr arr type)
(-> list? any/c string?)
(format
"{~a}"
(string-join
(map (lambda (x) (format type x))
arr) ",")))
(define/contract (compile-ass-arr arr type1 type2)
(-> list? any/c any/c string?)
(format
"{~a}"
(string-join
(map (lambda (x) (format (++ type1 "=" type2) (first x) (second x)))
arr) ",")))

763
example-mod.rkt Normal file
View File

@ -0,0 +1,763 @@
#reader(lib"read.ss""wxme")WXME0108 ##
#|
This file uses the GRacket editor format.
Open this file in DrRacket version 6.11 or later to read it.
Most likely, it was created by saving a program in DrRacket,
and it probably contains a program with non-text elements
(such as images or comment boxes).
http://racket-lang.org/
|#
35 7 #"wxtext\0"
3 1 6 #"wxtab\0"
1 1 8 #"wximage\0"
2 0 8 #"wxmedia\0"
4 1 34 #"(lib \"syntax-browser.ss\" \"mrlib\")\0"
1 0 36 #"(lib \"cache-image-snip.ss\" \"mrlib\")\0"
1 0 68
(
#"((lib \"image-core.ss\" \"mrlib\") (lib \"image-core-wxme.rkt\" \"mr"
#"lib\"))\0"
) 1 0 16 #"drscheme:number\0"
3 0 44 #"(lib \"number-snip.ss\" \"drscheme\" \"private\")\0"
1 0 36 #"(lib \"comment-snip.ss\" \"framework\")\0"
1 0 93
(
#"((lib \"collapsed-snipclass.ss\" \"framework\") (lib \"collapsed-sni"
#"pclass-wxme.ss\" \"framework\"))\0"
) 0 0 43 #"(lib \"collapsed-snipclass.ss\" \"framework\")\0"
0 0 19 #"drscheme:sexp-snip\0"
0 0 29 #"drscheme:bindings-snipclass%\0"
1 0 101
(
#"((lib \"ellipsis-snip.rkt\" \"drracket\" \"private\") (lib \"ellipsi"
#"s-snip-wxme.rkt\" \"drracket\" \"private\"))\0"
) 2 0 88
(
#"((lib \"pict-snip.rkt\" \"drracket\" \"private\") (lib \"pict-snip.r"
#"kt\" \"drracket\" \"private\"))\0"
) 0 0 55
#"((lib \"snip.rkt\" \"pict\") (lib \"snip-wxme.rkt\" \"pict\"))\0"
1 0 34 #"(lib \"bullet-snip.rkt\" \"browser\")\0"
0 0 25 #"(lib \"matrix.ss\" \"htdp\")\0"
1 0 22 #"drscheme:lambda-snip%\0"
1 0 29 #"drclickable-string-snipclass\0"
0 0 26 #"drracket:spacer-snipclass\0"
0 0 57
#"(lib \"hrule-snip.rkt\" \"macro-debugger\" \"syntax-browser\")\0"
1 0 18 #"java-comment-box%\0"
1 0 23 #"java-interactions-box%\0"
1 0 26 #"drscheme:pict-value-snip%\0"
0 0 45 #"(lib \"image-snipr.ss\" \"slideshow\" \"private\")\0"
1 0 38 #"(lib \"pict-snipclass.ss\" \"slideshow\")\0"
2 0 55 #"(lib \"vertical-separator-snip.ss\" \"stepper\" \"private\")\0"
1 0 18 #"drscheme:xml-snip\0"
1 0 31 #"(lib \"xml-snipclass.ss\" \"xml\")\0"
1 0 21 #"drscheme:scheme-snip\0"
2 0 34 #"(lib \"scheme-snipclass.ss\" \"xml\")\0"
1 0 10 #"text-box%\0"
1 0 32 #"(lib \"text-snipclass.ss\" \"xml\")\0"
1 0 1 6 #"wxloc\0"
0 0 78 0 1 #"\0"
0 75 1 #"\0"
0 12 90 -1 90 -1 3 -1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 255 255 255 1 -1 0 9
#"Standard\0"
0 75 10 #"Monospace\0"
0 12 90 -1 90 -1 3 -1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 255 255 255 1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 -1 -1 2 24
#"framework:default-color\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 150 0 150 0 0 0 -1 -1 2 15
#"text:ports out\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 150 0 150 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 255 0 0 0 0 0 -1
-1 2 15 #"text:ports err\0"
0 -1 1 #"\0"
1 0 -1 -1 93 -1 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 175 0 0 0 -1 -1 2 17
#"text:ports value\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 175 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 34 139 34 0 0 0 -1
-1 2 27 #"Matching Parenthesis Style\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 34 139 34 0 0 0 -1
-1 2 1 #"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 38 38 128 0 0 0 -1 -1 2 37
#"framework:syntax-color:scheme:symbol\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 38 38 128 0 0 0 -1 -1 2 38
#"framework:syntax-color:scheme:keyword\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 38 38 128 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 194 116 31 0 0 0 -1 -1 2
38 #"framework:syntax-color:scheme:comment\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 194 116 31 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 41 128 38 0 0 0 -1 -1 2 37
#"framework:syntax-color:scheme:string\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 41 128 38 0 0 0 -1 -1 2 35
#"framework:syntax-color:scheme:text\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 41 128 38 0 0 0 -1 -1 2 39
#"framework:syntax-color:scheme:constant\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 41 128 38 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 132 60 36 0 0 0 -1 -1 2 49
#"framework:syntax-color:scheme:hash-colon-keyword\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 132 60 36 0 0 0 -1 -1 2 42
#"framework:syntax-color:scheme:parenthesis\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 132 60 36 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 36
#"framework:syntax-color:scheme:error\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 36
#"framework:syntax-color:scheme:other\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 16
#"Misspelled Text\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 81 112 203 0 0 0 -1 -1 2
38 #"drracket:check-syntax:lexically-bound\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 81 112 203 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 178 34 34 0 0 0 -1 -1 2 28
#"drracket:check-syntax:set!d\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 178 34 34 0 0 0 -1 -1 2 37
#"drracket:check-syntax:unused-require\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 36
#"drracket:check-syntax:free-variable\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 68 0 203 0 0 0 -1 -1 2 31
#"drracket:check-syntax:imported\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 68 0 203 0 0 0 -1 -1 2 47
#"drracket:check-syntax:my-obligation-style-pref\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 178 34 34 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 116 0 0 0 0 -1 -1 2 50
#"drracket:check-syntax:their-obligation-style-pref\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 116 0 0 0 0 -1 -1 2 48
#"drracket:check-syntax:unk-obligation-style-pref\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 139 142 28 0 0 0 -1 -1 2
49 #"drracket:check-syntax:both-obligation-style-pref\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 139 142 28 0 0 0 -1 -1 2
26 #"plt:htdp:test-coverage-on\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 1 0 0 0 0 0 0 255 165 0 0 0 0 -1 -1 2 27
#"plt:htdp:test-coverage-off\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 1 0 0 0 0 0 0 255 165 0 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 194 116 31 0 0 0 -1 -1 2
41 #"profj:syntax-colors:scheme:block-comment\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 194 116 31 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 35
#"profj:syntax-colors:scheme:keyword\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 139 0 139 0 0 0 -1 -1 2 37
#"profj:syntax-colors:scheme:prim-type\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 139 0 139 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 38 38 128 0 0 0 -1 -1 2 38
#"profj:syntax-colors:scheme:identifier\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 38 38 128 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 34 139 34 0 0 0 -1 -1 2 34
#"profj:syntax-colors:scheme:string\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 34 139 34 0 0 0 -1 -1 2 35
#"profj:syntax-colors:scheme:literal\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 34 139 34 0 0 0 -1 -1 2 35
#"profj:syntax-colors:scheme:comment\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 194 116 31 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 33
#"profj:syntax-colors:scheme:error\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 35
#"profj:syntax-colors:scheme:default\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 37
#"profj:syntax-colors:scheme:uncovered\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 35
#"profj:syntax-colors:scheme:covered\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 139 0 139 0 0 0 -1 -1 4 1
#"\0"
0 70 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 4 4 #"XML\0"
0 70 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 37 #"plt:module-language:test-coverage-on\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 38
#"plt:module-language:test-coverage-off\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 1 0 0 0 0 0 0 255 165 0 0 0 0 -1 -1 4 1
#"\0"
0 71 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 4 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0 0 0 1.0 1.0 1.0 0 0 255 0 0 0 -1
-1 4 1 #"\0"
0 71 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0 0 0 1.0 1.0 1.0 0 0 255 0 0 0 -1
-1 4 1 #"\0"
0 71 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 0 100 0 0 0 0 -1
-1 0 1 #"\0"
0 75 10 #"Monospace\0"
0.0 12 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 150 0 150 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 93 -1 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 0 0 0 0
0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 175 0 0
0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 200 0 0 0 0
0 -1 -1 4 1 #"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 255 255 0 -1 -1
0 419 0 28 3 12 #"#lang racket"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 17 3 14 #";Housecleaning"
0 0 24 29 1 #"\n"
0 0 17 3 62
#";TODO: Helpful compiler messages: don't allow same name things"
0 0 24 29 1 #"\n"
0 0 17 3 46 #";TODO: Do #lang? (What's a marketable name??)"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 17 3 9 #";Features"
0 0 24 29 1 #"\n"
0 0 17 3 28 #";TODO: Support custom blocks"
0 0 24 29 1 #"\n"
0 0 17 3 22 #";TODO: Support recipes"
0 0 24 29 1 #"\n"
0 0 17 3 24 #";TODO: Support particles"
0 0 24 29 1 #"\n"
0 0 17 3 19 #";TODO: Support mobs"
0 0 24 29 1 #"\n"
0 0 17 3 49 #";TODO: Support callback functions on the above..."
0 0 24 29 1 #"\n"
0 0 17 3 55 #";TODO: Support building. (Functional API, not drones.)"
0 0 24 29 1 #"\n"
0 0 17 3 29 #";TODO: Active block modifiers"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 3 1 #"("
0 0 15 3 7 #"require"
0 0 24 3 1 #" "
0 0 14 3 11 #"2htdp/image"
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 3 1 #"("
0 0 15 3 7 #"require"
0 0 24 3 1 #" "
0 0 19 3 10 #"\"core.rkt\""
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 1 #"("
0 0 15 3 7 #"require"
0 0 24 3 1 #" "
0 0 19 3 12 #"\"blocks.rkt\""
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 1 #"("
0 0 15 3 7 #"require"
0 0 24 3 1 #" "
0 0 19 3 11 #"\"items.rkt\""
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 1 #"("
0 0 15 3 7 #"require"
0 0 24 3 1 #" "
0 0 19 3 14 #"\"compiler.rkt\""
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 17 3 9 #";MY MOD!!"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 3 1 #"("
0 0 15 3 6 #"define"
0 0 24 3 2 #" ("
0 0 14 3 11 #"image->item"
0 0 24 3 1 #" "
0 0 14 3 5 #"image"
0 0 24 3 1 #" "
0 0 23 3 6 #"#:name"
0 0 24 3 2 #" ("
0 0 14 3 4 #"name"
0 0 24 3 1 #" "
0 0 19 3 1 #"\""
0 0 19 3 10 #"Temp Name\""
0 0 24 3 2 #") "
0 0 23 3 13 #"#:description"
0 0 24 3 2 #" ("
0 0 14 3 4 #"desc"
0 0 24 3 1 #" "
0 0 19 3 9 #"\"Missing\""
0 0 24 3 2 #"))"
0 0 24 29 1 #"\n"
0 0 24 3 3 #" ("
0 0 14 3 11 #"custom-item"
0 0 24 29 1 #"\n"
0 0 24 3 3 #" "
0 0 14 3 4 #"name"
0 0 24 29 1 #"\n"
0 0 24 3 3 #" "
0 0 23 3 13 #"#:description"
0 0 24 3 1 #" "
0 0 14 3 4 #"desc"
0 0 24 29 1 #"\n"
0 0 24 3 3 #" "
0 0 23 3 7 #"#:image"
0 0 24 3 1 #" "
0 0 14 3 5 #"image"
0 0 24 3 2 #"))"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 3 1 #"("
0 0 15 3 6 #"define"
0 0 24 3 2 #" ("
0 0 14 3 10 #"my-diamond"
0 0 24 3 1 #" "
0 0 14 3 9 #"dot-color"
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 3 #" ("
0 0 14 3 11 #"image->item"
0 0 24 29 1 #"\n"
0 0 24 3 4 #" ("
0 0 14 3 7 #"overlay"
0 0 24 3 2 #" ("
0 0 14 3 6 #"square"
0 0 24 3 1 #" "
0 0 21 3 2 #"20"
0 0 24 3 1 #" "
0 0 19 3 7 #"\"solid\""
0 0 24 3 1 #" "
0 0 14 3 9 #"dot-color"
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 20 #" "
0 2 15 21 1 #"\0"
2 -1.0 -1.0 0.0 0.0 0 2 500
(
#"\211PNG\r\n\32\n\0\0\0\rIHDR\0\0\0\226\0\0\0\226\b"
#"\6\0\0\0<\1q\342\0\0\3'IDATx\234\355\3351\213]E\30"
#"\200\341\273\262\26\302\246P\202H\n\t\"\b61]*K\e\e\265\22$b"
#"\355?\260\262\264\212\225\225\215D-\254"
#"\324\312\302\302z\273\230\bV\22\4AR\204Xl\304Ba\375\3.9\237\334"
#"\327s\357\372<\3650;\27^\246\371"
#"\230\263\a\247\247\247\233\363\344\302\265\253"
#"{\371\203N\216o\35\254}\206mzl\355\3p>\t\213\204\260H\b\213\204"
#"\260H\b\213\204\260H\b\213\204\260H"
#"\b\213\204\260H\34\256}\200G\231\316\376N\216oUGIM~\347>\314\25"
#"\335X$\204EBX$\204EBX$\204EBX$\204EBX$\204E"
#"b\225\221\316p|1\332\373\263?\356\215\317S\270rx4Z\377\374\3477\26"
#"\257\375\27c\256\377|\4\344\306\"!,\22\302\"!,\22\302\"!,\22\302"
#"\"!,\22\302\"!,\22\302\"\261\225Ya\371D\353\316\237\17\307\347\251\\"
#"\177\342\231\305k_}pg\264\367\245\247..^\373\323h\347u\270\261H\b"
#"\213\204\260H\b\213\204\260H\b\213\204"
#"\260H\b\213\204\260H\b\213\304\316\177"
#"\321\357\366_\263\221\316d\3542\35\27"
#"M\326\177p\341\271\321\336\357\235\334]"
#"\274v\362Tl\263Y\347k\201n,\22\302\"!,\22\302\"!,\22\302\""
#"!,\22\302\"!,\22\302\"!,\22g\316\nw\345s\216\223\331\337f\263"
#"\331\334\370\375\227\321\372]\361\343\27_"
#"/^\373\342\233\257\215\366^\343\271\230"
#"\e\213\204\260H\b\213\204\260H\b\213"
#"\204\260H\b\213\204\260H\b\213\204\260H\354\374\363\257]\372\242\337"
#"\276Z\343?\213\271\261H\b\213\204\260H\b\213\204\260H\b\213\204\260"
) 364
(
#"H\b\213\204\260H\b\213\204\260H\2542+\274rx\264x\355[?|7\332"
#"\373\235\27\256N\217\263wn\177\370\361\332Gx$7\26\ta\221\20\26\ta"
#"\221\20\26\ta\221\20\26\ta\221\20\26\ta\221Xe\2443\371OW\317^"
#"\276<\332\373\243\233\237\fO\263\e\216"
#"\256\275\224\355\375\360\370\373l\357\263\270"
#"\261H\b\213\204\260H\b\213\204\260H"
#"\b\213\204\260H\b\213\204\260H\b\213"
#"\204\260H\34\234\236\216\276\f\370\217\246"
#"\237\27|\371\233\233\213\327N\237:="
#"\371\306+\243\365\273\342\267/\277]\274"
#"v\372\e\177~\367\375\305k\317\372\364"
#"\343\224\e\213\204\260H\b\213\204\260H"
#"\b\213\204\260H\b\213\204\260H\b\213"
#"\204\260H\254\362\374\353\327\a\367\327\370"
#"\263\347\306\32\317\271\246\334X$\204EBX$\204EBX$\204EBX$"
#"\204EBX$\204EBX$\2662+\234>\31\232<\27\273\370\366\353\363\3"
#"\355\241\307/=\275x\355\375O\277\32\355\275\255']\23n,\22\302\"!,"
#"\22\302\"!,\22\302\"!,\22\302\"!,\22\302\"\261\225/\372\225\246_"
#"\v\374?XcD3\345\306\"!,\22\302\"!,\22\302\"!,\22\302\""
#"!,\22\302\"!,\22\302\"\36171=\177~[\354\16x\0\0\0\0IEND\256B`\202"
) 0 0 24 29 1 #"\n"
0 0 24 3 21 #" )"
0 0 24 29 1 #"\n"
0 0 24 3 3 #" "
0 0 23 3 6 #"#:name"
0 0 24 3 2 #" ("
0 0 14 3 13 #"string-append"
0 0 24 3 1 #" "
0 0 19 3 20 #"\"diamond_fragments_\""
0 0 24 3 1 #" "
0 0 14 3 9 #"dot-color"
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 3 #" "
0 0 23 3 13 #"#:description"
0 0 24 3 1 #" "
0 0 19 3 1 #"\""
0 0 19 3 11 #"My Diamond\""
0 0 24 3 2 #"))"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 3 1 #"("
0 0 15 3 6 #"define"
0 0 24 3 2 #" ("
0 0 14 3 5 #"fract"
0 0 24 3 1 #" "
0 0 14 3 1 #"i"
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 3 #" ("
0 0 14 3 5 #"above"
0 0 24 3 1 #" "
0 0 14 3 1 #"i"
0 0 24 29 1 #"\n"
0 0 24 3 10 #" ("
0 0 14 3 6 #"beside"
0 0 24 3 1 #" "
0 0 14 3 1 #"i"
0 0 24 3 1 #" "
0 0 14 3 1 #"i"
0 0 24 3 3 #")))"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 3 1 #"("
0 0 15 3 6 #"define"
0 0 24 3 2 #" ("
0 0 14 3 8 #"my-shape"
0 0 24 3 1 #" "
0 0 14 3 4 #"base"
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 3 #" ("
0 0 14 3 5 #"fract"
0 0 24 29 1 #"\n"
0 0 24 3 4 #" ("
0 0 14 3 5 #"fract"
0 0 24 29 1 #"\n"
0 0 24 3 4 #" "
0 0 14 3 4 #"base"
0 0 24 3 3 #")))"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 3 1 #"("
0 0 15 3 6 #"define"
0 0 24 3 2 #" ("
0 0 14 3 10 #"cool-block"
0 0 24 3 1 #" "
0 0 14 3 5 #"color"
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 3 #" ("
0 0 14 3 12 #"block-struct"
0 0 24 3 2 #" ("
0 0 14 3 2 #"++"
0 0 24 3 1 #" "
0 0 19 3 11 #"\"my_block_\""
0 0 24 3 1 #" "
0 0 14 3 5 #"color"
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 17 #" ("
0 0 14 3 2 #"++"
0 0 24 3 1 #" "
0 0 19 3 5 #"\"My \""
0 0 24 3 1 #" "
0 0 14 3 5 #"color"
0 0 24 3 1 #" "
0 0 19 3 8 #"\" block\""
0 0 24 3 2 #") "
0 0 24 29 1 #"\n"
0 0 24 3 17 #" ("
0 0 14 3 4 #"list"
0 0 24 3 2 #" ("
0 0 14 3 7 #"overlay"
0 0 24 29 1 #"\n"
0 0 24 3 24 #" ("
0 0 14 3 6 #"square"
0 0 24 3 1 #" "
0 0 21 3 1 #"5"
0 0 24 3 1 #" "
0 0 19 3 7 #"\"solid\""
0 0 24 3 1 #" "
0 0 19 3 7 #"\"black\""
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 24 #" ("
0 0 14 3 6 #"square"
0 0 24 3 1 #" "
0 0 21 3 2 #"14"
0 0 24 3 1 #" "
0 0 19 3 7 #"\"solid\""
0 0 24 3 1 #" "
0 0 14 3 5 #"color"
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 24 #" ("
0 0 14 3 6 #"square"
0 0 24 3 1 #" "
0 0 21 3 2 #"20"
0 0 24 3 1 #" "
0 0 19 3 7 #"\"solid\""
0 0 24 3 1 #" "
0 0 19 3 7 #"\"black\""
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 24 #" ("
0 0 14 3 6 #"square"
0 0 24 3 1 #" "
0 0 21 3 2 #"31"
0 0 24 3 1 #" "
0 0 19 3 7 #"\"solid\""
0 0 24 3 1 #" "
0 0 14 3 5 #"color"
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 24 #" ("
0 0 14 3 6 #"square"
0 0 24 3 1 #" "
0 0 21 3 2 #"33"
0 0 24 3 1 #" "
0 0 19 3 7 #"\"solid\""
0 0 24 3 1 #" "
0 0 19 3 7 #"\"black\""
0 0 24 3 3 #")))"
0 0 24 29 1 #"\n"
0 0 24 3 16 #" "
0 0 21 3 1 #"'"
0 0 24 3 2 #"(("
0 0 19 3 8 #"\"cracky\""
0 0 24 3 1 #" "
0 0 21 3 1 #"3"
0 0 24 3 3 #") ("
0 0 19 3 7 #"\"stone\""
0 0 24 3 1 #" "
0 0 21 3 1 #"1"
0 0 24 3 4 #"))))"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 3 1 #"("
0 0 15 3 6 #"define"
0 0 24 29 1 #"\n"
0 0 24 3 2 #" "
0 0 14 3 6 #"my-mod"
0 0 24 29 1 #"\n"
0 0 24 3 3 #" ("
0 0 14 3 3 #"mod"
0 0 24 3 1 #" "
0 0 19 3 6 #"\"test\""
0 0 24 29 1 #"\n"
0 0 24 3 6 #" ("
0 0 14 3 10 #"cool-block"
0 0 24 3 1 #" "
0 0 19 3 5 #"\"red\""
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 6 #" ("
0 0 14 3 10 #"cool-block"
0 0 24 3 1 #" "
0 0 19 3 7 #"\"green\""
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 6 #" ("
0 0 14 3 10 #"cool-block"
0 0 24 3 1 #" "
0 0 19 3 6 #"\"blue\""
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 6 #" ("
0 0 14 3 10 #"cool-block"
0 0 24 3 1 #" "
0 0 19 3 9 #"\"magenta\""
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 6 #" ("
0 0 14 3 10 #"cool-block"
0 0 24 3 1 #" "
0 0 19 3 6 #"\"cyan\""
0 0 24 3 6 #") "
0 0 24 29 1 #"\n"
0 0 24 3 6 #" ("
0 0 14 3 11 #"image->item"
0 0 24 3 2 #" ("
0 0 14 3 8 #"my-shape"
0 0 24 3 2 #" ("
0 0 14 3 8 #"triangle"
0 0 24 3 1 #" "
0 0 21 3 2 #"10"
0 0 24 3 1 #" "
0 0 19 3 7 #"\"solid\""
0 0 24 3 1 #" "
0 0 19 3 5 #"\"red\""
0 0 24 3 3 #")) "
0 0 23 3 6 #"#:name"
0 0 24 3 1 #" "
0 0 19 3 14 #"\"zelda_thing1\""
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 6 #" ("
0 0 14 3 11 #"image->item"
0 0 24 3 2 #" ("
0 0 14 3 8 #"my-shape"
0 0 24 3 2 #" ("
0 0 14 3 6 #"circle"
0 0 24 3 1 #" "
0 0 21 3 2 #"10"
0 0 24 3 1 #" "
0 0 19 3 7 #"\"solid\""
0 0 24 3 1 #" "
0 0 19 3 7 #"\"green\""
0 0 24 3 3 #")) "
0 0 23 3 6 #"#:name"
0 0 24 3 1 #" "
0 0 19 3 14 #"\"zelda_thing2\""
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 6 #" ("
0 0 14 3 11 #"image->item"
0 0 24 3 2 #" ("
0 0 14 3 8 #"my-shape"
0 0 24 3 2 #" ("
0 0 14 3 6 #"square"
0 0 24 3 1 #" "
0 0 21 3 2 #"10"
0 0 24 3 1 #" "
0 0 19 3 7 #"\"solid\""
0 0 24 3 1 #" "
0 0 19 3 6 #"\"blue\""
0 0 24 3 3 #")) "
0 0 23 3 6 #"#:name"
0 0 24 3 1 #" "
0 0 19 3 14 #"\"zelda_thing3\""
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 6 #" ("
0 0 14 3 10 #"my-diamond"
0 0 24 3 1 #" "
0 0 19 3 7 #"\"green\""
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 6 #" ("
0 0 14 3 10 #"my-diamond"
0 0 24 3 1 #" "
0 0 19 3 5 #"\"red\""
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 6 #" ("
0 0 14 3 10 #"my-diamond"
0 0 24 3 1 #" "
0 0 19 3 6 #"\"blue\""
0 0 24 3 3 #")))"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 3 1 #"("
0 0 14 3 11 #"compile-mod"
0 0 24 3 1 #" "
0 0 14 3 6 #"my-mod"
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0

67
items.rkt Normal file
View File

@ -0,0 +1,67 @@
#lang racket
(provide item-struct)
(provide item-struct?)
(provide compile-items)
;ONLY provide this to the end user?
(provide custom-item)
(require 2htdp/image)
(require "core.rkt")
(struct item-struct asset-struct (image) #:transparent)
(define/contract (export-image-to-file m i)
(-> mod-struct? item-struct? boolean?)
(save-image (item-struct-image i)
(string-append (path-for m)
"/textures/"
(asset-name i) ".png")))
(define/contract (compile-item-inventory_image m i)
(-> mod-struct? item-struct? string?)
(format "inventory_image = ~s" (++ (asset-name i) ".png") ))
;minetest.register_craftitem("test:diamond_fragments", {
; description = "Alien Diamond Fragments",
; inventory_image = "my_diamonds.png"
;})
(define/contract (compile-item m i)
(-> mod-struct? item-struct? string?)
(++ "-- My item is named " (asset-name i) "\n"
(format
" minetest.register_craftitem(\"~a:~a\", {
~a,
~a,
})\n\n" (mod-struct-name m) (asset-name i)
(compile-asset-description m i)
(compile-item-inventory_image m i))))
(define/contract (export-item-code m i)
(-> mod-struct? item-struct? boolean?)
(with-output-to-file (lua-file-for m) #:exists 'append
(lambda () (printf (++
(compile-item m i)
"\n"))))
#t)
(define (custom-item name
#:description (desc "Missing Description")
#:image (image "missing.png"))
(item-struct name desc image))
(define/contract (compile-items m is)
(-> mod-struct? (listof item-struct?) boolean?)
(and
(all-true (map (curry export-image-to-file m) is))
(all-true (map (curry export-item-code m) is))
))

47
recipes.rkt Normal file
View File

@ -0,0 +1,47 @@
#lang racket
(provide recipe-struct)
(provide recipe-struct?)
(provide compile-recipes)
(require 2htdp/image)
(require "core.rkt")
(struct recipe-struct asset-struct (input output) #:transparent)
;minetest.register_craft({
; output = "mymod:diamond_chair 99",
; recipe = {
; {"mymod:diamond_fragments", "", ""},
; {"mymod:diamond_fragments", "mymod:diamond_fragments", ""},
; {"mymod:diamond_fragments", "mymod:diamond_fragments", ""}
; }
;})
(define/contract (compile-recipe m i)
(-> mod-struct? recipe-struct? string?)
(++ "-- My recipe is named " (asset-name i) "\n"
(format
" minetest.register_recipe(\"~a:~a\", {
~a,
~a,
})\n\n" (mod-struct-name m) (asset-name i)
(compile-recipe-output m i)
(compile-recipe-input m i))))
(define/contract (export-recipe-code m i)
(-> mod-struct? recipe-struct? boolean?)
(with-output-to-file (lua-file-for m) #:exists 'append
(lambda () (printf (++
(compile-recipe m i)
"\n"))))
#t)
(define/contract (compile-recipes m rs)
(-> mod-struct? (listof recipe-struct?) boolean?)
(all-true (map (curry export-recipe-code m) is)))