Skip to content

Commit c9d5ca8

Browse files
committed
Support arcs in (lispkit draw turtle).
1 parent 33c6223 commit c9d5ca8

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

Sources/LispKit/Resources/Libraries/lispkit/draw/turtle.sld

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@
5555
left
5656
right
5757
forward
58-
backward)
58+
backward
59+
arc)
5960

6061
(import (lispkit base)
61-
(lispkit draw))
62+
(rename (lispkit draw) (arc arcshape)))
6263

6364
(begin
6465

@@ -134,6 +135,17 @@
134135
(let-optionals args ((turtle (current-turtle)))
135136
(forward (- len) turtle)))
136137

138+
(define (arc degrees radius . args)
139+
(let-optionals args ((turtle (current-turtle)))
140+
(if (turtle-pen-down? turtle)
141+
(with-drawing (turtle-drawing turtle)
142+
(draw (arcshape (point (turtle-x turtle) (turtle-y turtle))
143+
radius
144+
(turtle-angle turtle)
145+
(+ (radian degrees) (turtle-angle turtle))
146+
(> degrees 0)))))
147+
(turn degrees turtle)))
148+
137149
(define (radian angle)
138150
(inexact (/ (* angle pi) 180.0)))
139151
)

Sources/LispKitRepl/AppInfo.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public struct AppInfo {
4545
public static let buildDate = { () -> String in
4646
let dateFormatter = DateFormatter()
4747
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm"
48-
return dateFormatter.string(from: Date(timeIntervalSince1970: 1700961329))
48+
return dateFormatter.string(from: Date(timeIntervalSince1970: 1701005297))
4949
}()
5050
public static let buildAnnotation = " (\(AppInfo.buildDate))"
5151
}

0 commit comments

Comments
 (0)