-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.rkt
40 lines (28 loc) · 1018 Bytes
/
test.rkt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#lang racket
(require 2htdp/image)
(require "dsf/base.rkt")
(require "dsf/tree.rkt")
;; Examples of DSF formulas (description of structure followed by code)
;;--------------------------------------------------------------
"Disconnected mix of oil and water:"
(: w o)
"Disconnected mix of oil and water enclosed in gas:"
(@ (: w o) G)
"Connected solid-solid, overlapped with oil and enclosed in water:"
(define comp (σ s s))
(@ (& comp o) W)
"Try a new structure..."
;; Save Structures as Images (uncomment lines to test)
;;-------------------------------------------------------------
;; Example of saving image as .png in /out/ directory:
;; (define emulsion (@ (: o o) W)
;; (save-image emulsion "out/emulsion.png")
;; Tree Representation (uncomment lines to test
;;-------------------------------------------------------------
;; Define a tree
;; (define myStructure
;; '(@ (: w o) s))
;; Draw a tree
;; (draw-tree myStructure)
;; Save image of a tree
;; (save-tree myStructure "out/myStructure.png")