|
1 | 1 | ;;; LISPKIT DRAW TURTLE
|
2 | 2 | ;;;
|
3 |
| -;;; This is a simple library implementing turtle graphics. A new turtle plane gets created |
4 |
| -;;; by invoking `make-turtle`. `make-turtle` sets the origin of the plane as well as a scaling |
5 |
| -;;; factor. A range of functions for modifying the state of a turtle plane is provided: |
| 3 | +;;; This is a simple library implementing turtle graphics. A new turtle plane gets |
| 4 | +;;; created by invoking `make-turtle`. `make-turtle` sets the origin of the plane |
| 5 | +;;; as well as a scaling factor. A range of functions for modifying the state of a |
| 6 | +;;; turtle plane is provided: |
6 | 7 | ;;;
|
7 | 8 | ;;; - `(pen-up turtle)`: Lifts the turtle from the plane
|
8 | 9 | ;;; - `(pen-down turtle)`: Drops the turtle onto the plane
|
|
14 | 15 | ;;; - `(turn angle turtle)`: Turns the turtle by the given angle (in radians)
|
15 | 16 | ;;; - `(left angle turtle)`: Turn left by the given angle (in radians)
|
16 | 17 | ;;; - `(right angle turtle)`: Turn right by the given angle (in radians)
|
17 |
| -;;; - `(forward length turtle)`: Moves forward by `length` units drawing a line if the |
18 |
| -;;; pen is down |
19 |
| -;;; - `(backward length turtle)`: Moves backward by `length` units drawing a line if the |
20 |
| -;;; pen is down |
| 18 | +;;; - `(forward length turtle)`: Moves forward by `length` units drawing a |
| 19 | +;;; line if the pen is down |
| 20 | +;;; - `(backward length turtle)`: Moves backward by `length` units drawing a |
| 21 | +;;; line if the pen is down |
21 | 22 | ;;;
|
22 | 23 | ;;; Author: Matthias Zenger
|
23 |
| -;;; Copyright © 2018 Matthias Zenger. All rights reserved. |
| 24 | +;;; Copyright © 2018-2023 Matthias Zenger. All rights reserved. |
24 | 25 | ;;;
|
25 |
| -;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file |
26 |
| -;;; except in compliance with the License. You may obtain a copy of the License at |
| 26 | +;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use |
| 27 | +;;; this file except in compliance with the License. You may obtain a copy of the |
| 28 | +;;; License at |
27 | 29 | ;;;
|
28 | 30 | ;;; http://www.apache.org/licenses/LICENSE-2.0
|
29 | 31 | ;;;
|
30 |
| -;;; Unless required by applicable law or agreed to in writing, software distributed under the |
31 |
| -;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, |
32 |
| -;;; either express or implied. See the License for the specific language governing permissions |
33 |
| -;;; and limitations under the License. |
| 32 | +;;; Unless required by applicable law or agreed to in writing, software distributed |
| 33 | +;;; under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR |
| 34 | +;;; CONDITIONS OF ANY KIND, either express or implied. See the License for the |
| 35 | +;;; specific language governing permissions and limitations under the License. |
34 | 36 |
|
35 | 37 | (define-library (lispkit draw turtle)
|
36 | 38 |
|
37 | 39 | (export turtle?
|
38 | 40 | make-turtle
|
39 | 41 | current-turtle
|
40 | 42 | turtle-drawing
|
| 43 | + turtle-x |
| 44 | + turtle-y |
| 45 | + turtle-angle |
| 46 | + turtle-pen-down? |
41 | 47 | pen-up
|
42 | 48 | pen-down
|
43 | 49 | pen-color
|
|
0 commit comments