Removed shapes, fixes #69

This commit is contained in:
Devine Lu Linvega
2019-07-22 15:56:35 +09:00
parent 8f54f954d2
commit b694d6c8db
14 changed files with 7 additions and 10 deletions

View File

@@ -0,0 +1,13 @@
; basics
; define a variable
(def a 25)
(echo a)
; define a function
(defn add-two (a) (add 2 a))
(echo (add-two 4))
; use a lambda
(times 5
(λ (a) (echo (concat "time:" a))))

View File

@@ -0,0 +1,16 @@
; recursive
(clear)
(defn rec
(v)
(if
(gt v 0)
(
(stroke
(circle
(mul 5 v)
(mul 5 v)
(mul 5 v)) 1 "red")
(rec
(sub v 5)))))
(rec 100)

View File

@@ -0,0 +1,24 @@
; Shapes
(clear)
; variables
(def center-w (div (of (frame) "w") 2))
(def center-h (div (of (frame) "h") 2))
(def rad (div (of (frame) "h") 4))
; draw circle
(stroke
(circle center-w center-h rad) 2 "white")
; draw rect
(stroke
(rect
(sub center-w rad) (sub center-h rad) center-h center-h) 2 "white")
; draw line
(stroke
(line
(pos (sub center-w rad) center-h)
(pos (add center-w rad) center-h)))
(stroke (text 10 170 200 "HELL") 2 "pink")

8
examples/basics/svg.lisp Normal file
View File

@@ -0,0 +1,8 @@
(clear)
; ronin path
(stroke
(svg "M60,60 L195,60 A45,45 0 0,1 240,105 A45,45 0 0,1 195,150 L60,150 M195,150 A45,45 0 0,1 240,195 L240,240 ") 2 "white")
; outline
(stroke
(svg "M15,15 L15,15 L285,15 L285,285 L15,285 Z") 1 "#555")